Kotlin Heroes: Episode 6

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
1488 Kotlin Heroes: Episode 6 FINISHED False 9000 116522699 March 9, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 339 ) D Problemsolving Marathon PROGRAMMING *special binary search greedy

B"Polycarp has decided to do a problemsolving marathon. He wants to solve s problems in n days. Let a_i be the number of problems he solves during the i -th day. He wants to find a distribution of problems into days such that: Note that a_1 can be arbitrarily large. What is the largest value of a_n Polycarp can obtain? The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of testcases. Then the descriptions of t testcases follow. The only line of each testcase contains two integers n and s ( 1 <= n <= s <= 10^{18} ) -- the number of days and the number of problems Polycarp wants to solve. It's guaranteed that the distribution always exists within the given constraints. For each testcase print a single integer -- the maximum value of a_n . In the first testcase there is only one distribution: [15] . In the second testcase the distribution that maximizes a_n is: [2, 3, 4] . In the third testcase the distribution that maximizes a_n is: [2, 4] . [3, 3] is a valid distribution but a_n=3 which is smaller than 4 . [1, 5] is not a valid distribution because 5 > 2 cdot 1 . "...

Tutorials

88522

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
109494678 eatmore D March 9, 2021, 2:55 p.m. OK Kotlin TESTS 11 124 0
109498509 ir_1st_vil D March 9, 2021, 3:32 p.m. OK Kotlin TESTS 11 139 0
109496385 Aleks5d D March 9, 2021, 3:11 p.m. OK Kotlin TESTS 11 139 0
109494428 Egor D March 9, 2021, 2:52 p.m. OK Kotlin TESTS 11 139 0
109523968 zucyo05 D March 10, 2021, 1:55 a.m. OK Kotlin TESTS 11 140 0
109502199 voidf D March 9, 2021, 4:14 p.m. OK Kotlin TESTS 11 140 0
109497218 yakamoto D March 9, 2021, 3:19 p.m. OK Kotlin TESTS 11 155 0
109497699 lucifer1004 D March 9, 2021, 3:24 p.m. OK Kotlin TESTS 11 155 102400
109506956 lightseba D March 9, 2021, 5:14 p.m. OK Kotlin TESTS 11 156 0
109498692 nor D March 9, 2021, 3:34 p.m. OK Kotlin TESTS 11 156 0

remove filters

Back to search problems