|
|||
Windmill LotteryIn Windmillia, there is a special national lottery system. Everyone can get a number and participate in countless draws. The numbers owned by the players are put in two lines (Line1 and Line2) based on the number specification, and they will belong to that line forever. The numbers and draws are generated based on the following rules:
A draw can take place at any time if the count of the numbers in the two lines have the same parity. A draw is performed as follows:
Input SpecificationThe first line contains the values of a, b, c, d, and the starting value for Number (five space-separated numbers). The second line contains the values of La, Lb, Lc, Ld, and the starting value for LineHelper (five space-separated numbers). The third line contains the initial value of Offset and the value of n, the overall number of numbers generated, separated by a space. Input Limits and Constraints
Output SpecificationThe output should contain the result of every draw, one line for every number. Sample Input
Output for Sample Input
ExplanationAfter generating 30 numbers, the two arrays are sorted, because a draw is generated. After sorting, they are placed so that the middle points are in the same column:
Line1: 23 26 29 32 35 38 41 44 47 50 53 56 59 62 65 The draw is generated with Offset = –6 and rotationCount = 68. Line2 is rotated 68 times, and the –6th elements relative to the middle points are added together: (26 + 28) = 54 (mod 67). The result is printed. There was only one draw. |
|||
University of Debrecen; Faculty of Informatics; v. 09/30/2024 |