|
||||||||||
Let the Balloon Rise IITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 476 Accepted Submission(s): 160 Problem Description Contest will be end at 17:00! How excited it is to see balloons floating around. I knew you had solved the HDOJ 1004 Let the Balloon Rise already, so please settle the another version quickly. I have a lot of balloons and each has a color and I give each of them a number, same color has the same number. For example, red balloon is No.1, pink is No.2, black is No.3 . etc. I also have many rooms to store all the balloons. There are some rules : 1. Every room stores several balloons but no two have the same color. 2. Collect all the balloons, we can find each color has even number of times of balloons except one. Your task is to find which is the odd color and calculate its number of times. Input Input file consists from multiple data sets separated by one or more empty lines. Each data set represents a sequence of 32-bit (positive) integers (references) which are stored in compressed way. Each line of input set consists from three single space separated 32-bit (positive) integers X Y Z and they represent following sequence of No.X, X+Z, X+2*Z, X+3*Z, ¡, X+K*Z, ¡(while (X+K*Z)<=Y). This line represents that in this room there exists (K+1) balloons whose No. is No.X, No.X+Z, No.X+2*Z, No.X+3*Z, ¡, No.X+K*Z, ¡etc. Output For each input data set you should print to standard output new line of text with two integers separated by single space (first one is No. that occurs odd number of times and second one is count of that kind of balloon). If all have even number of times output ¡°None.¡± Sample Input
Sample Output
Author WhereIsHeroFrom Source | ||||||||||
|