In addition to regular schoolwork, jlsajfj frequently visits a website where programmers can practice writing algorithms. This website has an extensive list of classical problems which leaves most aspiring programmers satisfied. jlsajfj's favourite part of the website is the unconventional contest system.
Every month, the website hosts a contest with
User Y is equal or better than user Z when, for each of the
jlsajfj convinced a friend, Shinigami, to try out an amazing contest. However, the website prevents users from knowing the leaderboard position during the contest, as this may influence the users' performance, and further, the website normally posts the results one week later. This does not stop jlsajfj from discovering and accessing the well-hidden database on the website. This database contains the scoring distributions of all
Both jlsajfj and Shinigami want to be famous for implementing a system where you can check your improvement index, so they split the work (fairly unevenly). jlsajfj successfully builds a program which determines whether a specific scoring distribution occurred in the contest. But Shinigami is stuck trying to calculate the improvement index of a user. In total, there are
Input Specification
The first line contains the integers
The following
The next line contains
In each of the next
Output Specification
For each of the
Constraints
Subtask 1 [25%]
Subtask 2 [25%]
Subtask 3 [50%]
No additional constraints.
Sample Input
4 11 5
10 10 10 10
10 10 2 5
10 9 5 0
0 10 0 0
0 0 0 0
6
10 10 10 10
10 10 2 5
10 9 5 0
0 10 0 0
0 0 0 0
10 9 5 0
Sample Output
1
2
2
3
5
2
Comments
Why does 10 10 2 5 have the same improvement index of 10 9 5 0? Can someone explain?
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.