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 |
1566
|
Codeforces Global Round 16 |
FINISHED |
False |
9000 |
100365899 |
Sept. 12, 2021, 2:35 p.m. |
Problems
B'You are given two positive integers n and s . Find the maximum possible median of an array of n non-negative integers (not necessarily distinct), such that the sum of its elements is equal to s . A median of an array of integers of length m is the number standing on the lceil { frac{m}{2}} rceil -th (rounding up) position in the non-decreasing ordering of its elements. Positions are numbered starting from 1 . For example, a median of the array [20,40,20,50,50,30] is the lceil frac{m}{2} rceil -th element of [20,20,30,40,50,50] , so it is 30 . There exist other definitions of the median, but in this problem we use the described definition. The input consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Description of the test cases follows. Each test case contains a single line with two integers n and s ( 1 <= n, s <= 10^9 ) -- the length of the array and the required sum of the elements. For each test case print a single integer -- the maximum possible median. Possible arrays for the first three test cases (in each array the median is underlined): '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
128685346 |
gxlois |
A |
Sept. 13, 2021, 1:34 a.m. |
OK |
D |
TESTS |
11 |
31 |
3686400 |
|
|
128655566 |
reosfire |
A |
Sept. 12, 2021, 4:37 p.m. |
OK |
.NET Core C# |
TESTS |
11 |
156 |
14233600 |
|
|
remove filters
Back to search problems