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 purpose of new operator?
What is jump statement in C++?
What does ios :: app do in c++?
What can I safely assume about the initial values of variables which are not explicitly initialized?
Write a corrected statement in c++ so that the statement will work properly. if (x = y) x = 2*z;
Implement strncpy
Why should we use null or zero in a program?
What programming language should I learn first?
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
What does iomanip mean in c++?
What is the type of 'this' pointer?
What is virtual base class?