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 virtual destructors? Why they are used?

1 Answers  


How does c++ structure differ from c++ class?

0 Answers  


what are the characteristics of Class Members in C++?

0 Answers  


How can you quickly find the number of elements stored in a static array?

0 Answers  


What are structures and unions?

0 Answers  






Difference between shift left and shift right?

1 Answers   Symphony,


When there is a global variable and local variable with the same name, how will you access the global variable?

0 Answers  


what are difference between c and c++?

9 Answers   Accenture,


Carry out conversion of one object of user-defined type to another?

0 Answers  


What is pointer -to-members in C++? Give their syntax?

0 Answers   Honeywell, Zomato,


WHO DEVELOPED C++?

6 Answers  


How would you use qsort() function to sort an array of structures?

0 Answers  


Categories