![]() | ||||
Online Judge | Problem Set | Authors | Online Contests | User |
---|---|---|---|---|
Web Board Home Page F.A.Qs Announcement | Current Contest Past Contests Scheduled Contests Award Contest |
Standard Point System Time Limit:6000MS Memory Limit:65536K
Guangdong Province uses ¡°standard point¡± to evaluate their students in
the National Matriculation Examination. The calculating method is as
follows: For example, after all the papers of a certain subject are
marked, every students got a initial point which is an integer range
from 0 to 150. The Examination Center of Guangdong Province sorts all
the points from high to low. By computing the percentage of students
whose point is lower than this student, the student¡¯s standard point
can be calculated. The completely computing process is as below:
![]() Secondly, For a give student, assuming that the percentage of students whose point is lower than this student is x (0 <= x < 1), we can get the standard point sp(x) as below: ![]() Following the above steps, every percentage can be link to a certain standard point. As one of the best programmer nowadays, you are invited to write a program to transform the initial points to standard points. Input The input contains multiply
test cases. The first line in each case is an integer N (1 <= N
<= 1000000), representing the number of student. Then come N lines,
each contains a student¡¯s point (The point is an integer within the
range [0, 150]). The next line is an integer M (1 <= M <= 200),
representing the number of queries (These numbers are all from the last
N lines). Then come M line, each contains an initial point (also in the
range [0, 150]).
For each query in a case, output the standard point corresponding to the given initial point. You should print a blank line between cases. Sample Input
For a given function F(x), if we want to compute A (as show in (1)), we
can select a position integer n, and then compute B (using the formulas
given in (2) and (3)). It is known that if n is very large, the
difference between A and B will be very small.
![]() Huge input,scanf is recommended. Source POJ Monthly--2005.08.28,anonymous |
[Submit] [Go Back] [Status] [Discuss]
All Copyright Reserved 2003-2005 Ying Fuchen,Xu Pengcheng
Any problem, Please Contact Administrator