subject

Quarter Final Sample Test: 1 Greedy puppy
Tuzik is a little dog. But despite the fact he is still a puppy he already knows about the pretty things that coins are,
He knows that for every coin he can get very tasty bone from his master. He believes that some day he will find a
treasure and have loads of bones.
And finally he found something interesting. A wooden chest containing N coins! But as you should remember,
Tuzik is just a little dog, and so he can't open it by himself. Actually, the only thing he can really do is barking. He
can use his barking to attract nearby people and seek their help. He can set the loudness of his barking very
precisely, and therefore you can assume that he can choose to call any number of people from a minimum of 1. to a
maximum of
When people come and open the chest they divide all the coins between them in such a way that everyone will get
the same amount of coins and this amount is maximal possible. If some coins are not used they will leave it on the
ground and Tuzik will take them after they go away. Since Tuzik is clearly not a fool, he understands that his profit
depends on the number of people he will call. While Tuzik works on his barking, you have to find the maximum
possible number of coins he can get.
Input
The first line of the input contains an integer T denoting the number of test cases. Each of next T lines contains 2
space-separated integers: N and K, for this test case.โ€‹

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:30
In deadlock avoidance using bankerโ€™s algorithm, what would be the consequence(s) of: (i) a process declaring its maximum need as maximum possible for each resource. in other words, if a resource a has 5 instances, then each process declares its maximum need as 5. (ii) a process declaring its minimum needs as maximum needs. for example, a process may need 2-5 instances of resource a. but it declares its maximum need as 2.
Answers: 3
question
Computers and Technology, 24.06.2019 17:40
Pseudocode pld #6, pg. 117 start// declarations// number numbertoguess// number myguess; numbertoguess = 92// while myguess ! = numbertoguess// output " guess an integer number between 1 and 100"// input myguess// if (myguess == numbertoguess)// output "you guessed the correct number"// else// output "the number you guessed was incorrect. try again! "// end if// end while// output " for playing the guessing game. have a great day! "// stop
Answers: 3
question
Computers and Technology, 25.06.2019 10:30
How do you transfer an image onto a computer
Answers: 2
question
Computers and Technology, 25.06.2019 11:10
Plato: which view of report creation allows you to customize the report before the database program creates it?
Answers: 3
You know the right answer?
Quarter Final Sample Test: 1 Greedy puppy
Tuzik is a little dog. But despite the fact he is st...
Questions
question
Mathematics, 26.10.2020 05:10
question
Mathematics, 26.10.2020 05:10
question
Mathematics, 26.10.2020 05:10
question
Computers and Technology, 26.10.2020 05:10
question
Mathematics, 26.10.2020 05:10
question
History, 26.10.2020 05:10
Questions on the website: 13722367