Pinball Ranking | 프로그래밍의 벗 PivotOJ
PivotOJ

Pinball Ranking

시간 제한: 1000ms메모리 제한: 128MB출처: CCC 2005 SeniorBOJ 6880

문제

Pinball is an arcade game in which an individual player controls a silver ball by means of flippers, with the objective of accumulating as many points as possible. At the end of each game, the player's score and rank are displayed. The score, an integer between 00 and 10000000001\,000\,000\,000, is that achieved by the player in the game just ended. The rank is displayed as "rr of nn". nn is the total number of games ever played on the machine, and rr is the position of the score for the just-ended game within this set.

More precisely, rr is one greater than the number of games whose score exceeds that of the game just ended.

입력

You are to implement the pinball machine's ranking algorithm. The first line of input contains a positive integer, tt, the total number of games played in the lifetime of the machine. tt lines follow, given the scores of these games, in chronological order.

출력

You are to output the average of the ranks up to an absolute error of 10210^{-2} that would be displayed on the board.

At least one test case will have t100t \le 100. All test cases will have t100000t \le 100\,000.

힌트

The pinball screen would display (in turn):

1 of 1
1 of 2
2 of 3
2 of 4
5 of 5

The average rank is (1+1+2+2+5)/5=2.20(1+1+2+2+5)/5 = 2.20.

예제

예제 1

입력
5
100
200
150
170
50
출력
2.20
코드를 제출하려면 로그인하세요.