MSE07E - Showstopper

no tags 

Data-mining huge data sets can be a painful and long lasting process if we are not aware of tiny patterns existing within those data sets. One reputable company has recently discovered a tiny bug in their hardware video processing solution and they are trying to create software workaround. To achieve maximum performance they use their chips in pairs and all data objects in memory should have even number of references. Under certain circumstances this rule became violated and exactly one data object is referred by odd number of references. They are ready to launch product and this is the only showstopper they have. They need YOU to help them resolve this critical issue in most efficient way. Can you help them?

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 references: X, X+Z, X+2*Z, X+3*Z, …, X+K*Z, …(while (X+K*Z)<=Y).

Output

Your task is to data-mine input data and for each set determine weather data were corrupted, which reference is occurring odd number of times, and count that reference.

For each input data set you should print to standard output new line of text with either “no corruption” (low case) or two integers separated by single space (first one is reference that occurs odd number of times and second one is count of that reference).

Sample

Input :
1 10 1 
2 10 1 
 
1 10 1 
1 10 1 
 
1 10 1 
4 4 1 
1 5 1 
6 10 1 
Ouput: 
1 1 
no corruption 
4 3 

hide comments
:D: 2015-03-21 19:51:57

Be very careful with input formatting and remember that there may be more than one empty line between test cases. I solved the problem under following assumption / definition: every line ends with '\n' (ascii code 10) or EOF ("ascii code" -1 if read by getchar for example). Don't assume anything else. Like XilinX said, there probably are additional white spaces in lines apart from number separators.

Hellfire Temple: 2012-12-25 12:23:22

I have tried the official testdata and got AC.Can you tell me what's wrong with my program?

[Trichromatic] XilinX: 2009-04-17 18:19:53

Again. It's caused by hidden '\r' at the end of line. (It's our pleasure if you can notify this in the problem statement.)

Last edit: 2009-04-12 04:59:58
~!(*(@*!@^&: 2009-04-17 18:19:53

checked. Official test case from contest.
edit : no single zero appears.

Last edit: 2009-04-12 04:23:48
[Trichromatic] XilinX: 2009-04-17 18:19:53

Please check the test data. The problem statement says that "three single space separated 32-bit
(positive) integers X Y Z" but in the input file there are some test case with zi = 0.


Added by:~!(*(@*!@^&
Date:2009-04-12
Time limit:0.108s-1.107s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ERL JS-RHINO NODEJS PERL6 VB.NET
Resource:Southeastern European 2007