description
stringlengths
171
4k
code
stringlengths
94
3.98k
normalized_code
stringlengths
57
4.99k
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
l = [int(x) for x in input().split(" ")] n, w = l[:] l = [int(x) for x in input().split(" ")] l.sort() girls = l[:n] boys = l[n:] mg = girls[0] mb = boys[0] q1 = w / (3 * n) q2 = mb / 2 q3 = mg x = min(q1, min(q2, q3)) print(x * 3 * n)
ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING EXPR FUNC_CALL VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP VAR BIN_OP NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER ASS...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split(" ")) arr = input().split(" ") for i in range(2 * n): arr[i] = int(arr[i]) arr.sort() boysize = arr[n] girlsize = arr[0] x = min(boysize / 2, girlsize) print(min(w, 3 * x * n))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING FOR VAR FUNC_CALL VAR BIN_OP NUMBER VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR BIN_OP VAR NUMBER VAR EXPR FUNC_CALL VAR FUNC_CALL V...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = list(map(int, input().split())) a = list(map(int, input().split())) a.sort() b = a[n] g = a[0] if b >= 2 * g: ret = g * 2 * n + g * n elif b >= g: ret = b * n + float(b) / 2 * n print(min(ret, w))
ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR NUMBER IF VAR BIN_OP NUMBER VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR BIN_OP VAR VAR IF VAR VAR ASSIGN VAR BIN_OP BIN_OP...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = list(map(int, input().split())) a.sort() res = 0 g = a[0] * n + a[0] * 2 * n b = a[n] * n + a[n] / 2 * n if g > res and g <= w and a[0] * 2 <= a[n]: res = g elif b > res and b <= w and a[n] // 2 <= a[0]: res = b else: res = w print("{:.8f}".format(res))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR BIN_OP BIN_OP VAR NUMBER NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR BIN_OP BIN_OP VAR VAR NUMBER VAR IF VAR VAR VA...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) arr = list(map(int, input().split())) arr.sort() boy = arr[n] girl = arr[0] if girl * 2 < boy: boy = girl * 2 elif girl * 2 > boy: girl = boy / 2 print(min(n * (girl + boy), w))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR NUMBER IF BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER IF BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = [] a = list(map(int, input().split())) a.sort(reverse=True) boy_max = a[n - 1] girl_max = a[2 * n - 1] if girl_max * 2 < boy_max: boy_max = girl_max * 2 else: girl_max = boy_max / 2 tea_max = min(w, (girl_max + boy_max) * n) print(tea_max)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR VAR BIN_OP VAR NUMBER ASSIGN VAR VAR BIN_OP BIN_OP NUMBER VAR NUMBER IF BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VA...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
def pasha_and_tea(n, w, l): s = sorted(l) if s[n] >= s[0] * 2: girl = s[0] boy = s[0] * 2 else: girl = s[n] / 2 boy = s[n] if (girl + boy) * n <= w: print((girl + boy) * n) else: print(w) n, w = list(map(int, input().split())) l = list(map(int, input...
FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR IF VAR VAR BIN_OP VAR NUMBER NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP VAR VAR NUMBER ASSIGN VAR VAR VAR IF BIN_OP BIN_OP VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_C...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split(" ")) a = list(map(int, input().split(" "))) a.sort() b = a[n] g = a[0] res = g * n * 3 if res > b / 2 * n * 3: res = b / 2 * n * 3 if res > w: res = w print(res)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING EXPR FUNC_CALL VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER IF VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
values = input().split() n = int(values[0]) w = int(values[1]) cups = input().split() for i in range(2 * n): cups[i] = int(cups[i]) cups.sort() lowgirl = cups[0] lowboy = cups[len(cups) // 2] totalused = 0 if 2 * lowgirl <= lowboy: totalused = n * lowgirl + n * lowgirl * 2 else: totalused = n * (lowboy / 2)...
ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR BIN_OP NUMBER VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER ASSIGN VAR NU...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) t1 = w / (3 * n) a = list(map(int, input().split())) a.sort() a1 = a[n] a2 = a[0] if a1 / 2 <= a2: t = a1 / 2 else: t = a2 if t < t1: print(3 * n * t) else: print(w)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR BIN_OP NUMBER VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR NUMBER IF BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR VAR IF VAR VAR EXPR FUNC_CALL V...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = [int(i) for i in input().split()] capacity = [int(i) for i in input().split()] capacity.sort(reverse=True) result = min(capacity[2 * n - 1] * 3 * n, capacity[n - 1] * 3 / 2 * n, w) print(result)
ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP VAR BIN_OP BIN_OP NUMBER VAR NUMBER NUMBER VAR BIN_OP BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER NUMBER VAR VAR EXPR FUNC_CALL VAR VAR
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) l = list(map(int, input().split())) l.sort() b = [] g = [] for i in range(n): g.append(l[i]) i = n while i < 2 * n: b.append(l[i]) i += 1 low = 0 high = w itr = 200 m = 0 while itr: mid = (low + high) / 2 k = w f = 0 for i in range(n): o = g[i] ...
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR VAR ASSIGN VAR VAR WHILE VAR BIN_OP NUMBER VAR EXPR FUNC_CALL VAR VAR VAR VAR NUMBER ASSIGN VAR ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = list(map(int, input().split(" "))) cups = list(map(int, input().split(" "))) cups.sort() max_girl = cups[0] max_boy = cups[n] x = min(max_girl, max_boy / 2.0, w / (3.0 * n)) print(3 * x * n)
ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER BIN_OP VAR BIN_OP NUMBER VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
def init(): num_input = input() num_input = num_input.split(" ") n = int(num_input[0]) w = int(num_input[1]) a = input() a = a.split(" ") length = 2 * n for i in range(length): a[i] = int(a[i]) return a, n, w def solve(a, n, w): a.sort() cup = min(a[0], a[n] / 2) ...
FUNC_DEF ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR BIN_OP NUMBER VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR RETURN VAR VAR VAR FUNC_DEF EXPR ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
__author__ = "darinflar" n, w = map(int, input().split()) l = [int(i) for i in input().split()] l.sort() d = w for i in range(n): d = min(d, l[i]) m = w for i in range(n, 2 * n): m = min(m, l[i]) xd = min(d, w / (3 * n)) xm = min(m, 2 * w / (3 * n)) x = min(xd, xm / 2) x = 3 * x * n print(x)
ASSIGN VAR STRING ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR VAR FOR VAR FUNC_CALL VAR VAR BIN_OP NUMBER VAR ASSIGN VAR FUNC_CALL VAR VAR VAR...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
def answer(n, w, A): A.sort(reverse=True) maxb = A[n - 1] maxg = A[-1] if maxb <= 2 * maxg: maxg = maxb / 2 return min(3 * n * maxg, w) n, w = map(int, input().split()) arr = list(map(int, input().split())) print(answer(n, w, arr))
FUNC_DEF EXPR FUNC_CALL VAR NUMBER ASSIGN VAR VAR BIN_OP VAR NUMBER ASSIGN VAR VAR NUMBER IF VAR BIN_OP NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER RETURN FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VA...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) ai = list(map(int, input().split())) ai.sort() if ai[n] > ai[0] * 2: ai[n] = ai[0] * 2 if ai[n] * 1.5 * n > w: print(w) else: print(ai[n] * 1.5 * n)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR IF VAR VAR BIN_OP VAR NUMBER NUMBER ASSIGN VAR VAR BIN_OP VAR NUMBER NUMBER IF BIN_OP BIN_OP VAR VAR NUMBER VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR V...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
__author__ = "artyom" def main(): n, w = read(3) a = sorted(read(3)) r = min(a[0], a[n] / 2, w / (3 * n)) return 3 * r * n def read(mode=1, size=None): if mode == 0: return input().strip() if mode == 1: return int(input().strip()) if mode == 2: return input().stri...
ASSIGN VAR STRING FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER BIN_OP VAR VAR NUMBER BIN_OP VAR BIN_OP NUMBER VAR RETURN BIN_OP BIN_OP NUMBER VAR VAR FUNC_DEF NUMBER NONE IF VAR NUMBER RETURN FUNC_CALL FUNC_CALL VAR IF VAR NUMBER RETURN F...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
__author__ = "Данила" n, w = map(int, input().split()) a = list(map(int, input().split())) s = sum(a) a.sort() ans = min(3 * n * a[0], 3 * n * a[n] / 2, w) print(ans)
ASSIGN VAR STRING ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR VAR NUMBER BIN_OP BIN_OP BIN_OP NUMBER VAR VAR VAR NUMBER VAR EXPR FUNC_CALL VAR...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = list(map(int, input().split())) temp = sorted(a) m = min(temp[0], temp[n] / 2) total = 3 * m * n print(min(total, w))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP NUMBER VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = list(map(int, input().split())) minel = min(a) a.sort() a = a[n:] boys = 0 girls = 0 if minel * 2 > min(a): girls = min(a) / 2 boys = min(a) else: boys = minel * 2 girls = minel if boys * n + girls * n > w: print(w) else: print(boys * n + girls * n)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER IF BIN_OP VAR NUMBER FUNC_CALL VAR VAR ASSIGN VAR BIN_OP FUNC_CALL VAR VAR NUMBER ASSIGN VAR ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = list(map(int, input().split())) a.sort() cap = min(a[0], a[n] / 2) serve = min(w / n / 3, cap) ans = serve * 3 * n print(ans)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER BIN_OP VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR EXPR FUNC_CALL VAR VA...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = [x for x in list(map(int, input().strip().split()))] a.sort() c = a[len(a) // 2] * n d = a[0] * n q = w / 3 if q < d and 2 * q < c or abs(q - d) < 0.001 and abs(q * 2 - c) < 0.001: print(w) elif 2 * d > c: print(c + c / 2) elif 2 * d < c: print(d + d * 2) elif abs(c - d ...
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP VAR BIN_OP FUNC_CALL VAR VAR NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER IF VAR VAR BIN_OP NUMBER VAR VAR FUNC_C...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) arr = list(map(int, input().split())) arr.sort() maxGirl = arr[n] / 2 x = min(maxGirl, arr[0]) total = (n + 2 * n) * x if total <= w: print(total) else: print(w)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP NUMBER VAR VAR IF VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
first_line = list(map(int, input().split())) n = first_line[0] w = first_line[1] a = list(map(int, input().split())) a.sort() used = 0 if a[0] > a[n] / 2: used = a[n] / 2 * n + a[n] * n print(min(used, w)) else: used = a[0] * n + a[0] * 2 * n print(min(w, used))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER IF VAR NUMBER BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR NUMBER VAR BIN_OP VAR VAR VAR...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = list(map(int, input().split())) a.sort() girls = a[:n] boys = a[n:] x = 0 x = min(girls[0], boys[0] / 2) total = 3 * x * n print(min(total, w))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP NUMBER VAR VAR EXPR FUNC_CALL VAR F...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
nm = [int(i) for i in input().split()] arr = [int(i) for i in input().split()] arr.sort() print(min(nm[1] / 1, 3 * nm[0] * min(arr[0] / 1, arr[nm[0]] / 2)))
ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER BIN_OP BIN_OP NUMBER VAR NUMBER FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER BIN_OP VAR VAR NUMBER NUMBER
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
def read_data(): n, w = map(int, input().split()) As = list(map(int, input().split())) return n, w, As def solve(n, w, As): As.sort() cap_girls = As[0] cap_boys = As[n] if cap_girls * 2 < cap_boys: return min(cap_girls * 3 * n, w) else: return min(cap_boys * 1.5 * n, w)...
FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR RETURN VAR VAR VAR FUNC_DEF EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR IF BIN_OP VAR NUMBER VAR RETURN FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER VAR VAR RETURN FUNC_CALL VAR...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = list(map(int, input().split())) i = 0 j = len(a) - 1 total = 0 a.sort() smallest = min(a[n] / 2, a[i]) if w <= smallest: total = w else: while i < n: if total + smallest * 3 <= w: total += smallest * 3 else: total = w i += 1 pr...
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR BIN_OP FUNC_CALL VAR VAR NUMBER ASSIGN VAR NUMBER EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR BIN_OP VAR VAR NUMBER VAR VAR IF VAR VAR ASSIGN VAR VAR WHILE VAR VAR IF ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
x, y = map(int, input().split()) a = list(map(int, input().split())) b = x * 3 s = y / b a.sort() z = len(a) // 2 k = min(a[z:]) p = min(a[:z]) w = min(s, k / 2, p) print(x * (w + 2 * w))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR ASSIGN VAR FU...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) A = list(map(int, input().split())) x = w / (3 * n) A = sorted(A, reverse=True) cup_max = A[len(A) // 2 - 1] cup_min = A[-1] if 2 * x > cup_max: cup_min = cup_max / 2 else: cup_max = 2 * x cup_min = x if A[-1] < cup_min: cup_min = A[-1] cup_max = cup_min * 2 tea = n ...
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR BIN_OP NUMBER VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR VAR BIN_OP BIN_OP FUNC_CALL VAR VAR NUMBER NUMBER ASSIGN VAR VAR NUMBER IF BIN_OP NUMBER VAR VAR ASSIGN VAR B...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
import sys n, w = map(int, input().split()) Array = list(map(int, input().split())) Array = sorted(Array) x = min(Array[0], Array[n] / 2) result = n * x + 2 * x * n if result > w: print(w) sys.exit(0) print(result)
IMPORT ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR BIN_OP BIN_OP NUMBER VAR VAR IF VAR VAR EXPR FUNC_CALL VAR VAR EXPR F...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
k = list(map(int, input().split())) n = k[0] w = k[1] a = list(map(int, input().split())) sort = sorted(a) boy = sort[n] girl = sort[0] x = 0 if boy / 2 >= girl: x = girl if girl * 2 >= boy: x = boy / 2 total = 3 * x * n if total > w: print(w) elif total - int(total) == 0: print(int(total)) else: pr...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR NUMBER ASSIGN VAR NUMBER IF BIN_OP VAR NUMBER VAR ASSIGN VAR VAR IF BIN_OP VAR ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split(" ")) a = list(map(int, input().split(" "))) a.sort() mingirl = a[0] minboy = a[n] wgirl = w / 3 wboy = w - wgirl if mingirl * 2 <= minboy: m = mingirl else: m = minboy / 2 q = min(m * n * 3, w) print(q)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR VAR IF BIN_OP VAR NUMBER VAR ASSIGN VAR VAR ASSIGN VAR BIN_OP VAR NUMBE...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = [int(x) for x in input().split()] sOC = [int(x) for x in input().split()] sOC.sort() r1 = sOC[n] r2 = sOC[0] if r1 / 2 <= r2: k = 3 / 2 * r1 * n if k < w: print(k) else: print(w) else: k = 3 * r2 * n if k < w: print(k) else: print(w)
ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR NUMBER IF BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER VAR VAR IF VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = list(map(int, input().split())) arr = list(map(int, input().split())) arr.sort() a = arr[0] b = arr[n] if a * 2 > b: a = b / 2 else: b = 2 * a print(min(w, a * n + b * n))
ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR IF BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP NUMBER VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR BI...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
import sys def main(): import sys tokens = [int(i) for i in sys.stdin.read().split()] tokens.reverse() n, w = tokens.pop(), tokens.pop() a = [tokens.pop() for i in range(2 * n)] a.sort() print(min(w, min(a[0], a[n] / 2) * 3 * n)) main()
IMPORT FUNC_DEF IMPORT ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL VAR BIN_OP NUMBER VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP BIN_OP FUNC_CALL VAR VAR NUMBER BIN_OP VAR VAR NUMBER ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) l_t = list(map(int, input().split())) l_t.sort() t_a = min(w / (3 * n), l_t[0], l_t[n] / 2) print(t_a * n * 3)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR BIN_OP VAR BIN_OP NUMBER VAR VAR NUMBER BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR NUMBER
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = list(map(int, input().split())) a = sorted(a) g = [] b = [] m = 0 cnt = 0 v = 0 minb = a[n] ming = a[0] for i in range(len(a)): g.append(a[i]) cnt += 1 if cnt == n: break for j in range(n, len(a), 1): b.append(a[j]) cnt += 1 if cnt == n: break...
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR LIST ASSIGN VAR LIST ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) cups = [int(i) for i in input().split()] cups.sort() if cups[n] >= cups[0] * 2: water = cups[0] * 3 * n if water > w: print(w) quit() else: print(water) quit() else: water = cups[n] * 3 / 2 * n if water > w: print(w) qu...
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR IF VAR VAR BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER NUMBER VAR IF VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VA...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split(" ")) mas = list(map(int, input().split(" "))) mas.sort() x1 = w / n / 3 x2 = mas[0] x3 = mas[n] / 2 print(3 * n * min(x1, x2, x3))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR FUNC_CALL VAR VAR VAR VA...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
class CodeforcesTask557BSolution: def __init__(self): self.result = "" self.n_w = [] self.cups = [] def read_input(self): self.n_w = [int(x) for x in input().split(" ")] self.cups = [int(x) for x in input().split(" ")] def process_task(self): self.cups.sort...
CLASS_DEF FUNC_DEF ASSIGN VAR STRING ASSIGN VAR LIST ASSIGN VAR LIST FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING FUNC_DEF EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER NUMBER VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUM...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse=False) min_girl = a[0] min_boy = a[n] * 0.5 if min_girl < min_boy: ans = min_girl * 3 * n * 1.0 else: ans = min_boy * 3 * n ans = min(ans, w) print("%.10f" % ans)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR NUMBER IF VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR ASSIGN VAR...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = list(map(int, input().split())) a = sorted(map(int, input().split())) x = min(min(a[:n]), min(a[n:]) / 2) print(min(w, 3 * n * x))
ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR BIN_OP FUNC_CALL VAR VAR VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP BIN_OP NUMBER VAR VAR
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
boy_count, amount_of_tea = map(int, input().split()) cups = map(int, input().split()) cups = sorted(cups) smallest_cup_girl = cups[0] smallest_cup_boy = cups[boy_count] tea_unit_needed = boy_count * 2 + boy_count min_amount = min(float(smallest_cup_girl), smallest_cup_boy / 2) total = min_amount * tea_unit_needed if am...
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR VAR IF VAR VAR AS...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = input().split() n = int(n) w = int(w) l = input().split() for i in range(2 * n): l[i] = int(l[i]) l.sort() g, b = l[0], l[n] if g * 2 > b: if n * (b / 2 + b) > w: print(w) else: print(n * (b / 2 + b)) elif n * (g + g * 2) > w: print(w) else: print(n * (g + g * 2))
ASSIGN VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR BIN_OP NUMBER VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR VAR NUMBER VAR VAR IF BIN_OP VAR NUMBER VAR IF BIN_OP VAR BIN_OP BIN_OP VAR N...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
tmp = input().split() n = int(tmp[0]) w = int(tmp[1]) arr = [] tmp = input().split() for i in tmp: arr.append(int(i)) arr.sort() if arr[n] / 2 <= arr[0] and arr[n] / 2 * 3 * n <= w: print("%.7f" % (arr[n] / 2 * 3 * n)) elif arr[0] * 3 * n <= w: print("%.7f" % (arr[0] * 3 * n)) else: print(w)
ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR LIST ASSIGN VAR FUNC_CALL FUNC_CALL VAR FOR VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR IF BIN_OP VAR VAR NUMBER VAR NUMBER BIN_OP BIN_OP BIN_OP VAR VAR NUMBER NUMBER VAR VAR EXPR FU...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split(" ")) a = list(map(int, input().split(" "))) a.sort() res = 0 if a[n] < a[0] * 2: res = 3.0 / 2 * a[n] * n else: res = 3.0 * n * a[0] if res > w: res = w print("%.10f" % res)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING EXPR FUNC_CALL VAR ASSIGN VAR NUMBER IF VAR VAR BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP NUMBER VAR VAR NUMBER IF V...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
def getMaxlWater(n, w, a): a.sort() minCup = min(a[0], a[n] / 2) if minCup * 3 * n > w: print(w) exit() return minCup * 3 * n n, w = map(int, input().split()) a = list(map(int, input().split())) result = getMaxlWater(n, w, a) if result % 1 != 0: print(result) else: print(int(re...
FUNC_DEF EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER BIN_OP VAR VAR NUMBER IF BIN_OP BIN_OP VAR NUMBER VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR RETURN BIN_OP BIN_OP VAR NUMBER VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
number_of_boys, capacity = map(int, input().split()) capacity_of_cups = list(map(int, input().split())) capacity_of_cups.sort() amount_of_girl = capacity_of_cups[0] amount_of_boy = capacity_of_cups[number_of_boys] pour = capacity / (3 * number_of_boys) if amount_of_girl == amount_of_boy: amount_of_girl = amount_of_...
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP NUMBER VAR IF VAR VAR ASSIGN VAR BIN_OP VAR NUMBER IF BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER IF...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = [int(c) for c in input().split()] a = [int(c) for c in input().split()] a.sort() maxgirl = w / (3 * n) for i in range(n): if a[i] < maxgirl: maxgirl = a[i] for i in range(n, 2 * n): if a[i] < 2 * maxgirl: maxgirl = a[i] / 2 print(maxgirl * 3 * n)
ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP VAR BIN_OP NUMBER VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR VAR ASSIGN VAR VAR VAR FOR VAR FUNC_CALL VAR VAR BIN_OP NUMBER VAR IF VAR VAR BIN_OP NUMBER VAR ASSIGN VAR...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = sorted(map(int, input().split())) g, b = min(a[:n]), min(a[n:]) v = [w] if 2 * g <= b: v.append(n * 3 * g) if b / 2 <= g: v.append(3 * n * b / 2) print(min(v))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR VAR ASSIGN VAR LIST VAR IF BIN_OP NUMBER VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER VAR IF BIN_OP VAR NUMBER VAR EXPR FUNC_CALL VAR ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = list(map(int, input().split())) a.sort() g = a[0] b = a[n] / 2 maxm = w / (3 * n) print(min(g, b, maxm) * 3 * n)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR BIN_OP NUMBER VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP FUNC_CALL VAR VAR VAR VAR NUMBER VAR
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = [int(x) for x in input().split(" ")] L = [int(x) for x in input().split(" ")] L.sort() x = L[0] y = L[n] if 2 * x > y: t = y / 2 else: t = x t = t * 3 * n if t > w: t = w print(t)
ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR IF BIN_OP NUMBER VAR VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR IF VAR VAR ASSIGN V...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
first = list(map(int, input().split())) arr = list(map(int, input().split())) n = first[0] l = len(arr) w = first[1] arr.sort() each = w / (n * 3) maxBoy = each * 2 minGirl = arr[0] minBoy = arr[l // 2] if minGirl * 2 > minBoy: minGirl = minBoy / 2 if each <= minGirl: print(w) else: print(minGirl * 3 * n)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR NUMBER EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR VAR NUMBER ASS...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = list(map(int, input().split())) a.sort() if 2 * a[0] <= a[n]: p = a[0] else: p = a[n] / 2 if 3 * n * p <= w: result = 3 * n * p else: result = w print(result)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR IF BIN_OP NUMBER VAR NUMBER VAR VAR ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR NUMBER IF BIN_OP BIN_OP NUMBER VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP NUMBER VAR VAR ASSIGN VAR...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = list(map(int, input().split())) a.sort() x = a[0] y = a[n] mini = min(float(y / 2), float(x)) res = float(mini * 3 * n) if res < w: print("%.6f" % res) else: print(w)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR BIN_OP VAR NUMBER FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER VAR IF VAR ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
def inp(): return map(int, input().split()) n, w = inp() a = list(inp()) a.sort() girls = a[:n] boys = a[n:] x = 0 if girls[0] * 2 > boys[0]: x = boys[0] / 2 else: x = girls[0] total = 3 * x * n if total > w: total = w print(total)
FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR NUMBER IF BIN_OP VAR NUMBER NUMBER VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
p = input().split() n = int(p[0]) w = int(p[1]) q = input().split() a = [] s = 0 for i in range(2 * n): a.append(int(q[i])) a.sort() if a[n] >= 2 * a[0]: s = n * a[0] + n * 2 * a[0] else: s = n * a[n] + n * (a[n] / 2) if s > w: print(w) else: print(s)
ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP NUMBER VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR IF VAR VAR BIN_OP NUMBER VAR NUMBER ASSIGN V...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
s = input() n, w = map(int, s.split()) s = input() sizes = list(map(int, s.split())) sizes.sort() x = min(sizes[0], sizes[n] / 2) ans = 3 * n * x if ans > w: print(w) else: print(ans)
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP NUMBER VAR VAR IF VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
def f(): [n, w] = list(map(int, input().split(" "))) a = list(map(int, input().split(" "))) a.sort() print(format(min(min(a[0], a[n] / 2) * 3 * n, w), ".20f")) f()
FUNC_DEF ASSIGN LIST VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP FUNC_CALL VAR VAR NUMBER BIN_OP VAR VAR NUMBER NUMBER VAR VAR STRING EXPR ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
datain = True if datain: n, w = map(int, input().split()) a = list(map(int, input().split())) else: n, w = 1, 5 a = [2, 3] a.sort() g = a[0] b = a[n] t = min(g, float(b / 2)) vol = 3 * t * n print(min(vol, w))
ASSIGN VAR NUMBER IF VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR NUMBER NUMBER ASSIGN VAR LIST NUMBER NUMBER EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL VAR BIN_OP VA...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) arr = list(map(int, input().split())) arr.sort() bg = arr[0] bb = arr[n] c = min(min(float(bg), bb / 2), min(bg * 2, bb) / 2) if c * 3 * n <= w: print(c * 3 * n) else: print(w)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER BIN_OP FUNC_CALL VAR BIN_OP VAR NUMBER VAR NUMBER IF BIN_OP B...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = input().split() for i in range(2 * n): a[i] = int(a[i]) a.sort() g = [] b = [] for i in range(2 * n): if i < n: g.append(a[i]) else: b.append(a[i] / 2) print(min(3 * n * min(min(g), min(b)), w))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR BIN_OP NUMBER VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST FOR VAR FUNC_CALL VAR BIN_OP NUMBER VAR IF VAR VAR EXPR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR BIN...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
__author__ = "myduomilia" n, volume = list(map(int, input().split())) arr = list(map(int, input().split())) arr.sort() up_limit = min(arr[0], arr[n] / 2, volume / (3 * n)) print("%0.10f" % (up_limit * 3 * n))
ASSIGN VAR STRING ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER BIN_OP VAR VAR NUMBER BIN_OP VAR BIN_OP NUMBER VAR EXPR FUNC_CALL VAR BIN_OP STRING BIN_OP BIN_OP VAR NUMBER ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
import sys n, w = [int(x) for x in input().split()[0:2]] water = input() water = [float(x) for x in water.split()] water = sorted(water) minNum = float(min(water[0], water[n] / 2)) result = minNum * 3 * n if result > w: result = w print(result)
IMPORT ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR IF VAR VAR ASSIGN VAR VAR...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = list(map(int, input().split())) a.sort() if 2 * a[0] <= a[n]: ans = min(3 * n * a[0], w) else: ans = min(3 / 2 * n * a[n], w) print(ans)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR IF BIN_OP NUMBER VAR NUMBER VAR VAR ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR VAR NUMBER VAR ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER VAR VAR VAR VAR ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = [int(x) for x in input().split()] caps = [int(x) for x in input().split()] caps.sort() g = caps[0] b = caps[n] if b < 2 * g: g = b / 2 print(min(g * 3 * n, w))
ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR IF VAR BIN_OP NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER VAR VAR
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
[n, w] = list(map(int, input().split())) arr = list(map(int, input().split())) tmpArr = list(reversed(sorted(arr))) x = min(tmpArr[n - 1] / 2, tmpArr[-1]) print(min(3 * x * n, w))
ASSIGN LIST VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR BIN_OP VAR BIN_OP VAR NUMBER NUMBER VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP N...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split(" ")) v = list(map(int, input().split(" "))) v = sorted(v) if v[n] / v[0] >= 2: x = v[0] else: x = v[n] / 2 sum = 3 * n * x if sum > w: sum = w print(sum)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR NUMBER NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP NUMBER VAR VAR IF VAR VAR ASSIGN VAR ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w, *vl = list(map(int, input().split(" "))) + list(map(int, input().split(" "))) vl.sort() print(3 * n * min(vl[n] / 2, vl[0], w / (3 * n)))
ASSIGN VAR VAR VAR BIN_OP FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR FUNC_CALL VAR BIN_OP VAR VAR NUMBER VAR NUMBER BIN_OP VAR BIN_OP NUMBER VAR
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
withFile = 0 if withFile == 1: fin = open("input.txt", "r") fout = open("output.txt", "w") def getl(): if withFile == 0: return input() else: return fin.readline() def printl(s): if withFile == 0: print(s) else: fout.write(str(s)) def get_arr(): x = getl...
ASSIGN VAR NUMBER IF VAR NUMBER ASSIGN VAR FUNC_CALL VAR STRING STRING ASSIGN VAR FUNC_CALL VAR STRING STRING FUNC_DEF IF VAR NUMBER RETURN FUNC_CALL VAR RETURN FUNC_CALL VAR FUNC_DEF IF VAR NUMBER EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_DEF ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING IF VAR NUMB...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = [int(i) for i in input().split()] capacity = [int(i) for i in input().split()] capacity.sort(reverse=True) result = 0 if capacity[n - 1] >= capacity[2 * n - 1] * 2: result = capacity[2 * n - 1] * 3 * n else: result = capacity[n - 1] * 3 / 2 * n if result <= w: print(result) else: print(w)
ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR NUMBER IF VAR BIN_OP VAR NUMBER BIN_OP VAR BIN_OP BIN_OP NUMBER VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP BIN_OP NUMBER VAR NUMBER NUMBER VAR ASSIGN VAR ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = list(map(int, input().split())) a.sort() g = a[0] b = a[n] if g * 2 <= b: b = g * 2 elif g * 2 > b: g = b / 2 ans = g * n + b * n if ans > w: ans = w print(ans)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR IF BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER IF BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
def main(): n, w = [int(t) for t in input().split()] a = sorted(int(t) for t in input().split()) min_girl_cup = a[0] min_boy_cup = a[n] max_girl_amount = min(min_girl_cup, min_boy_cup / 2) total = min(3 * max_girl_amount * n, w) print(total) main()
FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = sorted(list(map(int, input().split()))) if a[n] < a[0] * 2: s = 1.5 * a[n] else: s = 3 * a[0] print(min(s * n, w))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP NUMBER VAR VAR ASSIGN VAR BIN_OP NUMBER VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP VAR VAR VAR
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) l = list(map(int, input().split())) sortedArray = sorted(l) girls = sortedArray[0:n] boys = sortedArray[n : n * 2] minGirl = girls[0] minBoy = boys[0] teaBoys = 0 teaGirls = 0 if minBoy / 2 <= minGirl: teaBoys = minBoy * n teaGirls = minBoy / 2 * n else: minBoy = minGirl * 2...
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR NUMBER VAR ASSIGN VAR VAR VAR BIN_OP VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER IF BIN_OP VAR NUMBER VAR...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, m = map(int, input().split()) l = list(map(int, input().split())) S = sorted(l) v = S[0] g = S[n] l1 = v * n + g * n if l1 - m < 0: m = l1 p = m / 3 p1 = p * 2 t = p / n t1 = p1 / n if t1 > g: t1 = g t = t1 / 2 if t > v: t = v t1 = v * 2 print((t + t1) * n)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR IF BIN_OP VAR VAR NUMBER ASSIGN VAR VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VA...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
friends_and_teapotsize = list(map(int, list(input().split()))) cup_size = list(map(int, list(input().split()))) total_boys = friends_and_teapotsize[0] total_teapot = friends_and_teapotsize[1] cup_size.sort(reverse=False) smallest_girl_cup = cup_size[0] smallest_boy_cup = cup_size[total_boys] tea_per_girl = 0 if smalles...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR NUMBER IF BIN_OP VAR NUMBER VAR ASSI...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, cap = map(int, input().split()) a = sorted(map(int, input().split())) g, b = a[0], a[n] left, right = 0, g for _ in range(70): mid = (left + right) / 2 if mid * 2 <= b: left = mid else: right = mid left, right = 0, left for _ in range(70): mid = (left + right) / 2 if mid * n + mid...
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR VAR NUMBER VAR VAR ASSIGN VAR VAR NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER IF BIN_OP VAR NUMBER VAR ASSIGN VAR VAR ASSIGN VAR VAR ASSIGN VAR V...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = [int(x) for x in input().split()] a = [int(x) for x in input().split()] a.sort() t = min(a[0] * 2, a[len(a) // 2]) print(min(w, t * len(a) // 2 + t / 2 * (len(a) // 2)))
ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER VAR BIN_OP FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP BIN_OP BIN_OP VAR FUNC_CALL VAR VAR NUMBER BIN_OP BIN...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, m = map(int, input().split()) min1 = 1000000000000 min2 = 1000000000000 ar = list(map(int, input().split())) ar = list(sorted(ar)) for i in range(n): min1 = min(min1, ar[i]) for i in range(n, 2 * n): min2 = min(min2, ar[i]) if min1 * 2 <= min2: ans = min1 * 3 else: ans = min2 + min2 / 2 print(min(ans...
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR FOR VAR FUNC_CALL VAR VAR BIN_OP NUMBER VAR ASSIGN VAR...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
from sys import stdin n, w = map(int, stdin.readline().split()) an = list(map(int, stdin.readline().split())) an.sort() g = an[0] b = an[n] t = w / 3.0 print(min(min(g, t / n) * n * 3, min(b, t * 2 / n) * n * 3 / 2))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP FUNC_CALL VAR VAR BIN_OP VAR VAR VAR NUMBER BIN_OP BIN_OP BI...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) arr = list(map(int, input().split())) arr.sort() arr.reverse() boys, girls = arr[:n], arr[n : n * 2] if min(boys) / 2 >= min(girls): print(min(min(girls) * n + min(girls) * n * 2, w)) else: print(min(min(boys) * n + min(boys) * n / 2, w))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR VAR VAR VAR VAR BIN_OP VAR NUMBER IF BIN_OP FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP FUNC_CALL...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
inputt = input().split() n, w = int(inputt[0]), int(inputt[1]) arr = [int(i) for i in input().split()] arr.sort() li = min(arr[0] * n * 3, arr[n] * n * 3 / 2) li = min(li, w) print(li)
ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER VAR NUMBER BIN_OP BIN_OP BIN_OP VAR VAR VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR EXP...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) n *= 2 arr = list(map(int, input().split())) arr.sort() g = arr[: n // 2] b = arr[n // 2 :] first_g = g[0] first_b = b[0] if first_g * 2 > first_b: first_g = first_b / 2 elif first_g * 2 < first_b: first_b = first_g * 2 ans = first_g * n / 2 + first_b * n / 2 print(min(ans, w))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR BIN_OP VAR NUMBER ASSIGN VAR VAR BIN_OP VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER IF BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER IF...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = list(map(int, input().split())) teapots = list(map(int, input().split())) sorted_teapots = sorted(teapots) min_teapot_women = sorted_teapots[0] min_teapot_man = sorted_teapots[n] / 2 max_w = min(3 * n * min(min_teapot_women, min_teapot_man), w) print(max_w)
ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR FUNC_CALL VAR VAR VAR VAR EXPR FUNC_CALL VAR VAR
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = list(map(int, input().split())) a.sort() lo = min(a) hi = a[n] ref = min(2 * lo, hi) total = n * ref + n * ref / 2 print(min(total, w))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR FUNC_CALL VAR BIN_OP NUMBER VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR BIN_OP BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR F...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = list(map(int, input().split())) a.sort() w_limit = w / n b_min, b_max = a[n], a[-1] g_min, g_max = a[0], a[n - 1] x = 0 if g_min * 2 <= b_min: x = g_min else: x = b_min / 2 r = 3 * x * n print(r if w >= r else w)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR VAR VAR VAR VAR NUMBER ASSIGN VAR VAR VAR NUMBER VAR BIN_OP VAR NUMBER ASSIGN VAR NUMBER IF BIN_OP VAR NUMBER VAR ASSIGN VAR VAR ASSIGN VAR ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
s = list(map(int, input().split(" "))) n = s[0] w = s[1] s = list(map(int, input().split(" "))) s.sort() c1 = s[0] c2 = s[n] tmp = round(w / (n * 3), 6) if c2 / 2 > c1: if tmp > c1: print(c1 * 3 * n) else: print(w) elif tmp > c2 / 2: print(3 * n * c2 / 2) else: print(w)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR FUNC_CALL VAR BIN_OP VAR BIN_OP VAR NUMBER NUMBER IF BIN_...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
from sys import exit, stdin live = True if not live: stdin = open("data.in", "r") n, w = list(map(int, stdin.readline().strip().split())) cups = list(map(int, stdin.readline().strip().split())) maxx = w / (3 * n) cups = sorted(cups, reverse=True) for it in range(n): maxx = min(maxx, cups[it] / 2) for it in ran...
ASSIGN VAR NUMBER IF VAR ASSIGN VAR FUNC_CALL VAR STRING STRING ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR BIN_OP NUMBER VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER FOR VAR FUNC_CALL VAR ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
N, W = tuple(map(int, input().split(" "))) A = list(map(int, input().split(" "))) A.sort() smallest_girl = A[0] smallest_boy = A[N] smallest_girl = min(smallest_girl, smallest_boy / 2) smallest_boy = min(smallest_boy, smallest_girl * 2) max_pour = (smallest_boy + smallest_girl) * N print(min(W, max_pour))
ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER ASSIGN VAR BIN...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
def main(): n, w = map(int, input().split()) capacity = list(map(int, input().split())) capacity.sort() girlCap = capacity[0] boyCap = capacity[n] if 2 * girlCap <= boyCap: Total = 3 * n * capacity[0] else: Total = 1.5 * n * capacity[n] if Total > w: Total = w ...
FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR IF BIN_OP NUMBER VAR VAR ASSIGN VAR BIN_OP BIN_OP NUMBER VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP NUMBER VAR VAR VAR IF VAR VAR ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) a = list(map(int, input().split())) a.sort() print(min(w, min(a[0], a[n] * 0.5) * 3 * n))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP BIN_OP FUNC_CALL VAR VAR NUMBER BIN_OP VAR VAR NUMBER NUMBER VAR
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
n, w = map(int, input().split()) capa = list(map(int, input().split())) sorted = sorted(capa, reverse=True) x = min(sorted[n - 1] / 2, sorted[-1], w / (3 * n)) resultW = 3 * n * x print(resultW)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR BIN_OP VAR BIN_OP VAR NUMBER NUMBER VAR NUMBER BIN_OP VAR BIN_OP NUMBER VAR ASSIGN VAR BIN_OP BIN_OP NUMBER VAR VAR EXPR FUNC_CALL VAR ...
Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup can hold at most a_{i} milliliters of water. It turned out that among Pasha's friends there are exactly n boys and exactl...
a, k = map(int, input().split()) l = sorted(map(int, input().split())) print(min(k, a * (3 * min(l[a] / 2.0, l[0]))))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP VAR BIN_OP NUMBER FUNC_CALL VAR BIN_OP VAR VAR NUMBER VAR NUMBER
Nastya came to her informatics lesson, and her teacher who is, by the way, a little bit famous here gave her the following task. Two matrices $A$ and $B$ are given, each of them has size $n \times m$. Nastya can perform the following operation to matrix $A$ unlimited number of times: take any square square submatrix...
[r, c] = list(map(int, input().split())) mat1 = [] mat2 = [] flag = True for i in range(r): mat1.append(list(map(int, input().split()))) for i in range(r): mat2.append(list(map(int, input().split()))) def diag(matrix): diagmat = [] for line in range(1, r + c): start_col = max(0, line - r) ...
ASSIGN LIST VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_C...
Nastya came to her informatics lesson, and her teacher who is, by the way, a little bit famous here gave her the following task. Two matrices $A$ and $B$ are given, each of them has size $n \times m$. Nastya can perform the following operation to matrix $A$ unlimited number of times: take any square square submatrix...
n, m = map(int, input().split()) a = [list(map(int, input().split())) for _ in range(n)] b = [list(map(int, input().split())) for _ in range(n)] s = max(m, n) if n < s: for i in range(s - n): a.append([0] * s) b.append([0] * s) if m < s: for i in range(s): a[i] += [0] * (s - m) b...
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR IF VAR VAR FOR VAR FUNC_CALL VAR BIN_OP VAR VAR EXPR...
Nastya came to her informatics lesson, and her teacher who is, by the way, a little bit famous here gave her the following task. Two matrices $A$ and $B$ are given, each of them has size $n \times m$. Nastya can perform the following operation to matrix $A$ unlimited number of times: take any square square submatrix...
n, m = map(int, input().split()) def mtr(r): for _ in range(r): temp = map(int, input().split()) yield list(temp) def diag(x, t): temp = [[] for _ in range(1, m + n)] for i, j in list(zip(*[[i for i in range(t)], [i for i in range(t)]])): for k in x[j]: temp[i].append...
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR FUNC_DEF ASSIGN VAR LIST VAR FUNC_CALL VAR NUMBER BIN_OP VAR VAR FOR VAR VAR FUNC_CALL VAR FUNC_CALL VAR LIST VAR VAR FUNC_CALL VAR VAR VAR VAR FUNC_CAL...
Nastya came to her informatics lesson, and her teacher who is, by the way, a little bit famous here gave her the following task. Two matrices $A$ and $B$ are given, each of them has size $n \times m$. Nastya can perform the following operation to matrix $A$ unlimited number of times: take any square square submatrix...
def f(L): T = [] j = 0 for i in range(n): j = 0 s = 0 p = i while p >= 0 and j <= m - 1: s += L[p][j] p -= 1 j += 1 T.append(s) for j in range(1, m): i = n - 1 s = 0 q = j while q <= m - 1 and i >...
FUNC_DEF ASSIGN VAR LIST ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR VAR WHILE VAR NUMBER VAR BIN_OP VAR NUMBER VAR VAR VAR VAR VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR VAR WHILE...