Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.18 KB

README.md

File metadata and controls

36 lines (27 loc) · 1.18 KB

ENNGE-Challenge-2023-mission-1

Description

We want you to calculate the sum of squares of given integers, excluding any negatives.

The first line of the input will be an integer N (1 <= N <= 100), indicating the number of test cases to follow.

Each of the test cases will consist of a line with an integer X (0 < X <= 100), followed by another line consisting of X number of space-separated integers Yn (-100 <= Yn <= 100).

For each test case, calculate the sum of squares of the integers, excluding any negatives, and print the calculated sum in the output.

  • Note 1: There should be no output until all the input has been received.
  • Note 2: Do not put blank lines between test cases solutions.
  • Note 3: Take input from standard input, and output to standard output.

Rules

Write your solution using Python Programming Language.

Specific rules for Python solution

  • Your source code must be a single file, containing at least a main function
  • Do not use any for loop, while loop, or any list / set / dictionary comprehension
  • Your solution will be tested against Python 3.11 (as of February 2023)

Sample Input

2
4
3 -1 1 14
5
9 6 -53 32 16

Sample Output

206 1397