Problems
522 - Positive Integer Average
SUBMIT PROBLEM

Positive Integer Average

Time Limit: 1 sec

 

The Problem

Suppose you have N numbers. It could be positive number or negative. Your task is to find positive numbers average.

 

Example:

There are 5 numbers:

1 2 -1 -2 3

Here positive integers are 1, 2 and 3

The average = (1 + 2 + 3) / 3 = 2

 

The Input

The Input has several test cases. Each case contain two lines. First line is an integer number N (N <= 100). In second line there are N integer numbers are ranged to 0 to 100. If N is 0 the input file will terminate

 

The Output

For each line of input the output will print the average of all positive integers rounded to 3 decimal points in a separate line. If all are negative integers average will be 0.

 

Sample Input

5

1 2 -1 -2 3

6

-1 -2 -3 -4 -5 -6

0

 

Sample Output

2.000

0

 

 

 

 

Problem Setter: Samia Safa Ahmed