show that among any group of five (not necessary consecutive
) integers, there are two with the same remainder when
divided by 4.
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 |
What is virtual destructors? Why they are used?
How does c++ structure differ from c++ class?
what are the characteristics of Class Members in C++?
How can you quickly find the number of elements stored in a static array?
What are structures and unions?
Difference between shift left and shift right?
When there is a global variable and local variable with the same name, how will you access the global variable?
what are difference between c and c++?
Carry out conversion of one object of user-defined type to another?
What is pointer -to-members in C++? Give their syntax?
WHO DEVELOPED C++?
How would you use qsort() function to sort an array of structures?