show that among any group of five (not necessary consecutive
) integers, there are two with the same remainder when
divided by 4.



show that among any group of five (not necessary consecutive ) integers, there are two with the sam..

Answer / lalala

generalized pigeon principle: If N objects are placed into k
boxes, then there is at least one box containing at least (ceiling) N/k objects.

let k = 4 ;
find N:

N/4 = 2 , N= 5, in order to get the answer 2..

Is This Answer Correct ?    17 Yes 19 No

Post New Answer

More C++ General Interview Questions

What is purpose of new operator?

0 Answers  


What is jump statement in C++?

0 Answers   Ericsson,


What does ios :: app do in c++?

0 Answers  


What can I safely assume about the initial values of variables which are not explicitly initialized?

0 Answers  


Write a corrected statement in c++ so that the statement will work properly. if (x = y) x = 2*z;

2 Answers  






Implement strncpy

3 Answers  


Why should we use null or zero in a program?

0 Answers  


What programming language should I learn first?

0 Answers  


Must accepts "Maestro Cards" Tax for bike should be less than 15 Total number of lanes is more than 10 Must provides monthly pass Write a method: boolean isGoodTollBridge(String[] cardsAccepted, String[] tollTax, boolean hasMonthlyPass, int numberOfLanes); String[] cardsAccepted A String array of names of card types accepted for payment of toll tax, it can be null if the toll does not accept any card String[] tollTax A String array of toll tax chart (say “Train : 300”,”BullCart : 10”) boolean hasMonthlyPass This parameter defines whether there is any monthly pass available or not int numberOfLanes This parameter defines the number of lanes for each side

0 Answers   Telecom,


What does iomanip mean in c++?

0 Answers  


What is the type of 'this' pointer?

0 Answers  


What is virtual base class?

0 Answers  


Categories