description
stringlengths
171
4k
code
stringlengths
94
3.98k
normalized_code
stringlengths
57
4.99k
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
n = int(input()) x1, x2 = map(int, input().split()) left = [[0, 0, 0]] * n right = [[0, 0, 0]] * n for i in range(n): k, b = map(int, input().split()) left[i] = [k * x1 + b, k, i] right[i] = [k * x2 + b, -k, i] left.sort() right.sort() ans = "No" for i in range(n): if left[i][2] != right[i][2]: ...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP LIST LIST NUMBER NUMBER NUMBER VAR ASSIGN VAR BIN_OP LIST LIST NUMBER NUMBER NUMBER VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR LIST BIN_OP BIN_OP V...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
from sys import stdin def entryPoint(m, c): global x1 return m * x1 + c size, lines = int(input()), [] x1, x2 = map(int, input().split()) for l in stdin.readlines(): m, c = map(int, l.split()) lines.append((entryPoint(m, c), m, c)) lines.sort() for x in range(size - 1): if lines[x][1] != lines[x...
FUNC_DEF RETURN BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR LIST ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR BIN_OP VAR NUM...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
n = int(input()) x1, x2 = map(int, input().split(" ")) def intercepts(k, b): y1 = k * x1 + b y2 = k * x2 + b return [y1, y2] inter = [] for i in range(n): k, b = map(int, input().split(" ")) inter += [intercepts(k, b)] inter.sort() right = [] for i in range(n): intercept = inter[i] right...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING FUNC_DEF ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR RETURN LIST VAR VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING VAR LIST...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
def check(y1, y2, n): for i in range(n): if y1[i][1] != y2[i][1]: return "YES" return "NO" n = int(input()) eps = 10**-7 x1, x2 = map(int, input().split()) y1 = list() y2 = list() for i in range(n): k, b = map(int, input().split()) f = lambda x: k * x + b y1.append((f(x1 + eps)...
FUNC_DEF FOR VAR FUNC_CALL VAR VAR IF VAR VAR NUMBER VAR VAR NUMBER RETURN STRING RETURN STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP NUMBER NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
def main(): n = int(input()) x1, x2 = map(int, input().split()) res = [] for _ in range(n): k, b = map(int, input().split()) res.append((k * x1 + b, k * x2 + b)) res.sort() _, a = res[0] for _, b in res: if a > b: print("YES") return a ...
FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR VAR NUMBER ...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
import sys def main(): n = int(input()) x1, x2 = map(int, input().split()) s = [] for _ in range(n): k, b = map(int, sys.stdin.readline().split()) s += [[k * x1 + b, k * x2 + b]] s.sort() for i in range(1, n): if s[i][1] < s[i - 1][1]: print("YES") ...
IMPORT FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR LIST LIST BIN_OP BIN_OP VAR VAR VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NU...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
n = int(input()) done = False a, b = map(int, input().split()) a += 1 / 4000000 b -= 1 / 4000000 lol = [] wow = [] for i in range(n): k, c = map(int, input().split()) lol.append([k * a + c, i]) wow.append([k * b + c, i]) wow.sort() lol.sort() for i in range(n): if lol[i][1] != wow[i][1]: print("...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR BIN_OP NUMBER NUMBER VAR BIN_OP NUMBER NUMBER ASSIGN VAR LIST ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST BIN_OP BIN_OP VAR...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
n = int(input()) x1, x2 = map(int, input().split()) res = [0] * n for i in range(n): k, b = map(int, input().split()) res[i] = [k * x1 + b, k * x2 + b] res.sort() for i in range(n): res[i][0], res[i][1] = res[i][1], res[i][0] st = -1 for i in range(n): if i + 1 != n and res[i] == res[i + 1] and st == -1...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR LIST BIN_OP BIN_OP VAR VAR VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR FOR VAR FUNC_CAL...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
n = int(input().strip()) x1, x2 = [int(a) for a in input().strip().split()] intersect1 = [] for i in range(n): a, c = [int(a) for a in input().strip().split()] intersect1.append([a * x1 + c, a * x2 + c]) intersect1.sort(key=lambda element: (element[0], element[1])) for i in range(n - 1): if ( inters...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST BIN_OP BIN_OP VAR VAR VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_C...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
n = int(input()) R = lambda: map(int, input().split()) x1, x2 = R() b = [] V = lambda k, x, b: k * x + b for _ in range(n): ki, bi = R() v1 = V(ki, x1, bi) v2 = V(ki, x2, bi) b.append((v1, v2)) b = sorted(b) for i in range(n - 1): if b[i + 1][1] < b[i][1]: print("YES") exit() print("...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR EXPR FUNC_CALL VA...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
import sys n = int(sys.stdin.readline()) x1, x2 = map(int, sys.stdin.readline().split()) a = [] k = [0] * n for i in range(n): k[i] = list(map(int, sys.stdin.readline().split())) y1 = k[i][0] * x1 + k[i][1] y2 = k[i][0] * x2 + k[i][1] a.append((y1, y2)) a.sort() f = False x = a[0][1] for y1, y2 in a: ...
IMPORT ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER VAR VAR VAR NUMBER ASSIGN VAR ...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
def getSegment(line, x1, x2): x1 += 1e-09 x2 -= 1e-09 k, b = line P1 = x1, k * x1 + b P2 = x2, k * x2 + b return P1, P2 def doesIntersect(segment1, segment2): P11, P12 = segment1 P21, P22 = segment2 return (P11 < P21) != (P12 < P22) n = int(input()) data = [] x1, x2 = list(map(in...
FUNC_DEF VAR NUMBER VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR VAR VAR RETURN VAR VAR FUNC_DEF ASSIGN VAR VAR VAR ASSIGN VAR VAR VAR RETURN VAR VAR VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR F...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
n = int(input()) x1, x2 = [int(i) for i in input().split()] funcs = [] m = 0 L = [] R = [] for i in range(n): k = input() b = int(k.split()[1]) k = int(k.split()[0]) L.append((k * x1 + b, k, i)) R.append((k * x2 + b, -k, i)) L.sort() R.sort() L = [i[2] for i in L] R = [i[2] for i in R] print(["YES",...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR NUMBER ASSIGN VAR LIST ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR NUMBER EXPR FUNC_C...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
ada = False n = input() apapun = input().split() x1 = int(apapun[0]) x2 = int(apapun[1]) y = [] for i in range(int(n)): whatevs = "" whatevs = input().split() y.append( [int(whatevs[0]) * x1 + int(whatevs[1]), int(whatevs[0]) * x2 + int(whatevs[1])] ) y = sorted(y, key=lambda x: (x[0], x[1])) fo...
ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR STRING ASSIGN VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST BIN_OP BIN_OP FUNC_CALL VAR VAR NUMBE...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
n = int(input()) x1, x2 = [float(x) for x in input().split()] delta = 1e-07 y1 = list() y2 = list() new_x1 = x1 + delta new_x2 = x2 - delta for i in range(n): k, b = [int(x) for x in input().split()] y1.append((i, k * new_x1 + b)) y2.append((i, k * new_x2 + b)) y1.sort(key=lambda x: x[1]) y2.sort(key=lambda...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CAL...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
n = int(input()) x1, x2 = map(int, input().split()) ps = [map(int, input().split()) for _ in range(n)] ys = [0] * n for i, (k, b) in enumerate(ps): ys[i] = k * x1 + b, k * x2 + b ys.sort() max_y = -float("inf") ok = False for y1, y2 in ys: if y2 < max_y: ok = True break max_y = max(max_y, y2...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR VAR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR VAR VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
n = int(input()) x1, x2 = [int(x) for x in input().split(" ")] YSSorted = [] for i in range(n): k, b = [int(x) for x in input().split(" ")] y1 = k * x1 + b y2 = k * x2 + b YSSorted.append((y1, y2)) YSSorted.sort(reverse=True) def solve(YSSorted): minY2 = YSSorted[0][1] for y1, y2 in YSSorted: ...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR VAR VAR EX...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
n = int(input()) x1, x2 = map(int, input().split()) points = [list(map(int, input().split())) for _ in range(n)] one = list() two = list() for i in range(n): k, b = points[i] one.append((k * (x1 + 1e-10) + b, i)) two.append((k * (x2 - 1e-10) + b, i)) one.sort() two.sort() overlap = False for i in range(n): ...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL 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 VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
N = int(input()) x1, x2 = list(map(int, input().split())) x = [] y = [] for i in range(0, N): m, c = list(map(int, input().split())) x.append((m * (x1 + 1e-10) + c, i)) y.append((m * (x2 - 1e-10) + c, i)) x.sort() y.sort() a = [] b = [] for i in range(N): a.append(x[i][1]) b.append(y[i][1]) if a == ...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR VAR EXPR FUNC_C...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
import sys n = int(input()) k = [] b = [] x1, x2 = (int(i) for i in input().split()) for i in range(n): k1, b1 = (int(j) for j in input().split()) k.append(k1) b.append(b1) zn = [(k[i] * x1 + b[i], k[i] * x2 + b[i]) for i in range(n)] zn.sort() found = False for i in range(n - 1): if zn[i][1] > zn[i + ...
IMPORT ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR VAR VAR BIN...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
def main(): N = int(input()) X1, X2 = [int(i) for i in input().split()] X1 += 1e-08 X2 -= 1e-08 retas = [] for n in range(N): retas.append([int(i) for i in input().split()]) B1 = {} B2 = {} for n in range(N): k = retas[n][0] b = retas[n][1] B1[k * X1 +...
FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR VAR NUMBER VAR NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR DICT ASSIGN VAR DICT FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR NUMBE...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
n = int(input()) x1, x2 = map(int, input().split()) mass = [] for i in range(n): k, b = map(int, input().split()) mass.append((k, b)) tmp_mass = [0] * len(mass) for i in range(len(mass)): tmp_mass[i] = mass[i][1] + mass[i][0] * x1, mass[i][1] + mass[i][0] * x2 tmp_mass.sort(key=lambda x: (x[0], x[1])) flag ...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR ASSIGN VAR BIN_OP LIST NUMBER FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR...
The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these ...
import sys input = sys.stdin.readline n = int(input()) x1, x2 = map(int, input().split()) s = [] for _ in range(n): k, b = map(int, input().split()) s.append([x1 * k + b, x2 * k + b]) s.sort() ans = "NO" for i in range(1, n): x1, x2 = s[i - 1] x3, x4 = s[i] if x1 < x3 and x2 > x4 or x1 > x3 and x2 ...
IMPORT ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST BIN_OP BIN_OP VAR VAR VAR BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR ASSIGN V...
Write a program to find the n-th ugly number. Ugly numbers are positive integers which are divisible by a or b or c.   Example 1: Input: n = 3, a = 2, b = 3, c = 5 Output: 4 Explanation: The ugly numbers are 2, 3, 4, 5, 6, 8, 9, 10... The 3rd is 4. Example 2: Input: n = 4, a = 2, b = 3, c = 4 Output: 6 Explanation: The...
class Solution: def nthUglyNumber(self, n: int, a: int, b: int, c: int) -> int: ab = a * b // math.gcd(a, b) bc = b * c // math.gcd(c, b) ac = a * c // math.gcd(a, c) abc = ab * c // math.gcd(ab, c) def nthUgly(k: int) -> bool: h = k // a + k // b + k // c - k /...
CLASS_DEF FUNC_DEF VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR FUNC_CALL VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR FUNC_CALL VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR FUNC_CALL VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR FUNC_CALL VAR VAR VAR FUNC_DEF VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP...
Write a program to find the n-th ugly number. Ugly numbers are positive integers which are divisible by a or b or c.   Example 1: Input: n = 3, a = 2, b = 3, c = 5 Output: 4 Explanation: The ugly numbers are 2, 3, 4, 5, 6, 8, 9, 10... The 3rd is 4. Example 2: Input: n = 4, a = 2, b = 3, c = 4 Output: 6 Explanation: The...
class Solution: def nthUglyNumber(self, n: int, a: int, b: int, c: int) -> int: ab = a * b // math.gcd(a, b) bc = b * c // math.gcd(b, c) ca = a * c // math.gcd(c, a) abc = ab * c // math.gcd(ab, c) lo = 1 hi = 2 * 10**9 while lo < hi: m = (lo + h...
CLASS_DEF FUNC_DEF VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR FUNC_CALL VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR FUNC_CALL VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR FUNC_CALL VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR FUNC_CALL VAR VAR VAR ASSIGN VAR NUMBER ASSIGN VAR BIN_OP NUMBER BIN_OP NUMBER NUMBER W...
Write a program to find the n-th ugly number. Ugly numbers are positive integers which are divisible by a or b or c.   Example 1: Input: n = 3, a = 2, b = 3, c = 5 Output: 4 Explanation: The ugly numbers are 2, 3, 4, 5, 6, 8, 9, 10... The 3rd is 4. Example 2: Input: n = 4, a = 2, b = 3, c = 4 Output: 6 Explanation: The...
class Solution: def nthUglyNumber(self, n: int, a: int, b: int, c: int) -> int: def enough(num): total = ( num // a + num // b + num // c - num // ab - num // bc - num // ac + num //...
CLASS_DEF FUNC_DEF VAR VAR VAR VAR FUNC_DEF ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR BIN_OP VAR VAR BIN_OP VAR VAR BIN_OP VAR VAR BIN_OP VAR VAR BIN_OP VAR VAR RETURN VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR FUNC_CALL VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR FUNC_CALL VAR V...
Write a program to find the n-th ugly number. Ugly numbers are positive integers which are divisible by a or b or c.   Example 1: Input: n = 3, a = 2, b = 3, c = 5 Output: 4 Explanation: The ugly numbers are 2, 3, 4, 5, 6, 8, 9, 10... The 3rd is 4. Example 2: Input: n = 4, a = 2, b = 3, c = 4 Output: 6 Explanation: The...
class Solution: def nthUglyNumber(self, n: int, a: int, b: int, c: int) -> int: def gcd(a, b): while b: a, b = b, a % b return a def lcm(a, b): return a * b // gcd(a, b) def count_ugly(N, a, b, c): ab, ac, bc = lcm(a, b), lc...
CLASS_DEF FUNC_DEF VAR VAR VAR VAR FUNC_DEF WHILE VAR ASSIGN VAR VAR VAR BIN_OP VAR VAR RETURN VAR FUNC_DEF RETURN BIN_OP BIN_OP VAR VAR FUNC_CALL VAR VAR VAR FUNC_DEF ASSIGN VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR RETURN BIN_OP BIN_OP BIN_OP BIN_OP...
Write a program to find the n-th ugly number. Ugly numbers are positive integers which are divisible by a or b or c.   Example 1: Input: n = 3, a = 2, b = 3, c = 5 Output: 4 Explanation: The ugly numbers are 2, 3, 4, 5, 6, 8, 9, 10... The 3rd is 4. Example 2: Input: n = 4, a = 2, b = 3, c = 4 Output: 6 Explanation: The...
class Solution: def nthUglyNumber(self, n: int, a: int, b: int, c: int) -> int: def lcm(a, b): return a * b // math.gcd(a, b) nums = sorted([a, b, c]) nums2 = [lcm(a, b), lcm(b, c), lcm(a, c)] nums3 = lcm(nums2[0], c) lo, hi = n, nums[-1] * n while lo <...
CLASS_DEF FUNC_DEF VAR VAR VAR VAR FUNC_DEF RETURN BIN_OP BIN_OP VAR VAR FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL VAR LIST VAR VAR VAR ASSIGN VAR LIST FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER VAR ASSIGN VAR VAR VAR BIN_OP VAR NUMBER VAR WHILE VAR VAR ASSIGN...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
import sys A, B, C, D = [int(i) for i in sys.stdin.read().split()] if A * D - B * C == 0: print(0) else: k1 = abs(A + D + B + C) k2 = abs(A + D - B - C) k3 = abs(A - D + B - C) k4 = abs(A - D - B + C) print(abs(A * D - B * C) / max(k1, k2, k3, k4))
IMPORT ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR IF BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP V...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
a, b = list(map(int, input().split())) c, d = list(map(int, input().split())) z = a * d - b * c if z == 0: print(0) return t = max(abs(a + b + c + d), abs(a - b - c + d), abs(a - b + c - d), abs(a + b - c - d)) print(abs(z / t))
ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER RETURN ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR FUNC_CA...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
import sys A, B, C, D = [int(i) for i in sys.stdin.read().split()] if A * D - B * C == 0: result = 0 else: result = float("inf") for sa in [-1, 1]: for sb in [-1, 1]: for sc in [-1, 1]: for sd in [-1, 1]: coefA = sa * sd - sb * sc ...
IMPORT ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR IF BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR STRING FOR VAR LIST NUMBER NUMBER FOR VAR LIST NUMBER NUMBER FOR VAR LIST NUMBER NUMBER FOR VAR LIST NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR BIN_OP...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
a, b = [int(x) for x in input().split()] c, d = [int(x) for x in input().split()] def isCrossing(square1, square2): for vert in square1: if vert[0] == 0 or vert[1] == 0: return True if square2[0][1] <= vert[1] * square2[0][0] / vert[0] <= square2[1][1]: return True ...
ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF FOR VAR VAR IF VAR NUMBER NUMBER VAR NUMBER NUMBER RETURN NUMBER IF VAR NUMBER NUMBER BIN_OP BIN_OP VAR NUMBER VAR NUMBER NUMBER VAR NUMBER VAR NUMBER NUMBER RETURN NUMBER IF VAR NUMBER NUM...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
a, b = map(int, input().split()) c, d = map(int, input().split()) l = 0 r = 10**10 if a * d == b * c: print(0) else: for i in range(10000): x = (l + r) / 2 a1 = (a - x) * (d - x) a2 = (a + x) * (d + x) a3 = (a + x) * (d - x) a4 = (a - x) * (d + x) b1 = (b - x) * (...
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR BIN_OP NUMBER NUMBER IF BIN_OP VAR VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
a, b = map(int, input().split()) c, d = map(int, input().split()) mn = min(a * d, b * c) mx = max(a * d, b * c) x = 10**18 if a + b + c + d != 0: x = abs((b * c - a * d) / (a + b + c + d)) if a + b - c - d != 0: x = min(abs((b * c - a * d) / (a + b - c - d)), x) if a - b + c - d != 0: x = min(abs((b * c - a...
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR BIN_OP VAR VAR BIN_OP VAR VAR ASSIGN VAR FUNC_CALL VAR BIN_OP VAR VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP NUMBER NUMBER IF BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR NUMBER ASSIGN VAR FUNC_C...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
a, b = map(int, input().split()) c, d = map(int, input().split()) if a * d - b * c == 0: print(0) else: curpos = a * d - b * c >= 0 small = 0 large = 1e18 for iteration in range(200): avg = (small + large) / 2 works = False for ach in range(-1, 2, 2): for bch in r...
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER ASSIGN VAR BI...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
import itertools def minimize(m): ad = [m[0][0] * m[3][0], m[0][0] * m[3][1] + m[0][1] * m[3][0], m[0][1] * m[3][1]] bc = [m[1][0] * m[2][0], m[1][0] * m[2][1] + m[1][1] * m[2][0], m[1][1] * m[2][1]] det = [ad[0] - bc[0], ad[1] - bc[1], ad[2] - bc[2]] if det[0] != 0: disc = det[1] ** 2 - 4 * d...
IMPORT FUNC_DEF ASSIGN VAR LIST BIN_OP VAR NUMBER NUMBER VAR NUMBER NUMBER BIN_OP BIN_OP VAR NUMBER NUMBER VAR NUMBER NUMBER BIN_OP VAR NUMBER NUMBER VAR NUMBER NUMBER BIN_OP VAR NUMBER NUMBER VAR NUMBER NUMBER ASSIGN VAR LIST BIN_OP VAR NUMBER NUMBER VAR NUMBER NUMBER BIN_OP BIN_OP VAR NUMBER NUMBER VAR NUMBER NUMBER ...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
def work(A, B, C, D): tmp0 = A * D - B * C tmp1 = a * D + d * A - b * C - c * B tmp2 = a * d - b * c if tmp0 == 0: if tmp1 == 0 and tmp2 == 0: return 0 elif tmp1 != 0: return abs(tmp2 / tmp1) else: delta = tmp1 * tmp1 - tmp0 * tmp2 * 4 if delta...
FUNC_DEF ASSIGN VAR BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR BIN_OP VAR VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR IF VAR NUMBER IF VAR NUMBER VAR NUMBER RETURN NUMBER IF VAR NUMBER RETURN FUNC_CALL VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP BI...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
m = list(map(int, input().split() + input().split())) def f(r): a = (m[0] + r) * (m[3] + r) b = (m[0] + r) * (m[3] - r) c = (m[0] - r) * (m[3] + r) d = (m[0] - r) * (m[3] - r) x1 = min(a, b, c, d) x2 = max(a, b, c, d) a = (m[1] + r) * (m[2] + r) b = (m[1] + r) * (m[2] - r) c = (m[1...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP FUNC_CALL FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VA...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
a, b = map(int, input().split()) c, d = map(int, input().split()) if a == b == c == d == 0: print(0) else: x = max( abs(a + b + c + d), abs(a + b - c - d), abs(a - b + c - d), abs(a - b - c + d) ) print(abs((a * d - b * c) / x))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR VAR VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR FUNC_CALL VAR BIN_OP BIN_OP...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
import sys A, B, C, D = map(int, sys.stdin.read().split()) k = max(map(abs, [A + B + C + D, A + B - C - D, A - B + C - D, A - B - C + D])) + 1e-09 print((0, abs(A * D - B * C) / k)[bool(k)])
IMPORT ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP FUNC_CALL VAR FUNC_CALL VAR VAR LIST BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR NUMBER EXPR FUNC_CALL VAR NUMBER BIN_OP FUNC_...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
__author__ = "Данила" a, b = list(map(int, input().split())) c, d = list(map(int, input().split())) def solve(x, y, z): if y**2 - 4 * z * x < 0: return -(10**27) else: disi = y**2 - 4 * z * x return min(abs((-y + disi**0.5) / 2 * x), abs((-y - disi**0.5) / 2 * x)) if a * d - b * c ==...
ASSIGN VAR STRING ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF IF BIN_OP BIN_OP VAR NUMBER BIN_OP BIN_OP NUMBER VAR VAR NUMBER RETURN BIN_OP NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER BIN_OP BIN_OP NUMBER VA...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
def calc_range(x, y, d): l1 = x - d r1 = x + d l2 = y - d r2 = y + d points = sorted([l1 * l2, l1 * r2, r1 * l2, r1 * r2]) return points[0], points[3] def main(): a, b = map(int, input().split()) c, d = map(int, input().split()) l = 0.0 r = 10000000000.0 for iter in range(1...
FUNC_DEF ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR FUNC_CALL VAR LIST BIN_OP VAR VAR BIN_OP VAR VAR BIN_OP VAR VAR BIN_OP VAR VAR RETURN VAR NUMBER VAR NUMBER FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CA...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
def seg(x, y, h): A = [x - h, x + h] B = [y - h, y + h] Z = [] for a in A: for b in B: Z.append(a * b) Z.sort() return Z[0], Z[-1] def check(a, b, c, d, h): x1, y1 = seg(a, d, h) x2, y2 = seg(b, c, h) return max(x1, x2) <= min(y1, y2) a, b = map(int, input().s...
FUNC_DEF ASSIGN VAR LIST BIN_OP VAR VAR BIN_OP VAR VAR ASSIGN VAR LIST BIN_OP VAR VAR BIN_OP VAR VAR ASSIGN VAR LIST FOR VAR VAR FOR VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR RETURN VAR NUMBER VAR NUMBER FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR VAR RETURN...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
from sys import * a, b, c, d = map(int, stdin.read().split()) print(abs(a * d - b * c) / max(abs(a + b) + abs(c + d), abs(a - b) + abs(c - d), 1e-09))
ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR FUNC_CALL VAR BIN_OP FUNC_CALL VAR BIN_OP VAR VAR FUNC_CALL VAR BIN_OP VAR VAR BIN_OP FUNC_CALL VAR BIN_OP VAR VAR FUNC_CALL VAR BIN_OP VAR VAR NUMBER
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
a = abs A, B, C, D = map(int, (input() + " " + input()).split()) print(a(A * D - B * C) / max(a(A + B) + a(C + D) + 1e-09, a(A - B) + a(C - D)))
ASSIGN VAR VAR ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL BIN_OP BIN_OP FUNC_CALL VAR STRING FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR FUNC_CALL VAR BIN_OP BIN_OP FUNC_CALL VAR BIN_OP VAR VAR FUNC_CALL VAR BIN_OP VAR VAR NUMBER BIN_OP FUNC_CALL VAR BIN_OP VAR VAR...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
store1 = input("").split(" ") a = int(store1[0]) b = int(store1[1]) store2 = input("").split(" ") c = int(store2[0]) d = int(store2[1]) lo = 0 hi = 2 * 10**18 while hi - lo > 10**-10 * lo: mid = (hi + lo) / 2.0 mini = 2 * 10**19 maxi = -2 * 10**19 for t in range(1 << 4): store = [a, b, d, c] ...
ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING STRING ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING STRING ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR BIN_OP NUMBER BIN_OP NUMBER NUMBER WHILE BIN_OP V...
The determinant of a matrix 2 × 2 is defined as follows:$\operatorname{det} \left(\begin{array}{ll}{a} & {b} \\{c} & {d} \end{array} \right) = a d - b c$ A matrix is called degenerate if its determinant is equal to zero. The norm ||A|| of a matrix A is defined as a maximum of absolute values of its elements. You ar...
EPS = 1e-11 INF = float("inf") def multiply(a, b): m = INF M = -INF for i in range(2): for j in range(2): m = min(m, a[i] * b[j]) M = max(M, a[i] * b[j]) return m, M def intersect(a, b): return a[0] <= b[1] and b[0] <= a[1] a, b = map(float, input().split()) c, ...
ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR STRING FUNC_DEF ASSIGN VAR VAR ASSIGN VAR VAR FOR VAR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR VAR VAR VAR RETURN VAR VAR FUNC_DEF RETURN VAR NUMBER VAR NUMBER VAR NUMBER 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...
n, w = map(int, input().split()) a = list(map(int, input().split())) a.sort() if a[n] / a[0] >= 2: x = a[0] else: x = a[n] / 2 sum = 3 * n * x print(min(sum, 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 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 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()) ls = list(map(int, input().split())) ls.sort() mi = min(ls[0], ls[n] / 2) print(min(w, 3 * mi * 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 FUNC_CALL VAR VAR NUMBER BIN_OP 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...
n, w = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse=True) G = a[-1] B = a[n - 1] if B >= 2 * G: print(min(w, 3 * G * n)) else: G = B / 2 print(min(w, 3 * G * 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 NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR BIN_OP VAR NUMBER IF VAR BIN_OP NUMBER VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP BIN_OP NUMBER VAR VAR ASSIGN VAR BIN_OP 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()) cups = [int(cup) for cup in input().split()] cups.sort() girl_cup = cups[0] boy_cup = -1 for i in range(1, n + 1): boy_cup = cups[i] if boy_cup >= girl_cup * 2: break if boy_cup < girl_cup * 2: result = (boy_cup + boy_cup / 2) * n elif boy_cup > girl_cup * 2: res...
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 NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR VAR VAR IF VAR BIN_OP VAR NUMBER IF VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP 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...
def inp(): return map(int, input().split(" ")) n, w = inp() v = inp() v = sorted(v) if v[n] * 1.0 / v[0] >= 2.0: x = v[0] else: x = v[n] * 1.0 / 2.0 sum = 3.0 * n * x if sum > w: sum = w print(sum)
FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR IF BIN_OP BIN_OP VAR VAR NUMBER VAR NUMBER NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP NUMBER 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 = map(int, input().split()) a = list(map(int, input().split())) a.sort() res = 0 posi = a[n] / a[0] if posi >= 2: x = a[0] res = n * x * 2 + n * x else: x = a[n] res = n * x + n * x / 2 if res > w: res = w print(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 VAR VAR VAR NUMBER IF VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR NUMBER BIN_OP VAR VAR ASSIGN VAR VAR VAR ASSIG...
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() girl = a[:n] boy = a[n:] minG = min(girl) minB = min(boy) x = min(minG, minB / 2, w / (3 * n)) ans = 3 * x * n if ans - int(ans) == 0: print(int(ans)) else: 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 VAR ASSIGN VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER BIN_OP VAR BIN_OP NUMBER VAR ASSIG...
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()) a = list(sorted(map(int, input().split()))) q = min(min(a[:n]), min(a[n:]) / 2) print(min(q * 3 * n, w)) main()
FUNC_DEF 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 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 BIN_OP BIN_OP VAR 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...
n, w = map(int, input().split(" ")) c = input().split(" ") c = [int(i) for i in c] c.sort() k = min(c[0], c[n] / 2) * 3 * n print(min(k, w))
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP FUNC_CALL VAR VAR NUMBER BIN_OP VAR VAR NUMBER NUMBER 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 = (int(i) for i in input().split()) a = [int(i) for i in input().split()] a.sort() if 2 * a[0] <= a[n]: print(min(w, 3 * a[0] * n)) else: print(min(w, 1.5 * a[n] * 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 IF BIN_OP NUMBER VAR NUMBER VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP BIN_OP NUMBER VAR NUMBER VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP BIN_OP NUMBER 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(i) for i in input().split()] a = [int(i) for i in input().split()] c = w / 3 / n a.sort() if a[0] > c and a[n] > 2 * c: print(w) else: print(min(a[n] / 2, a[0]) * 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 ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR EXPR FUNC_CALL VAR IF VAR NUMBER VAR VAR VAR BIN_OP NUMBER VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP FUNC_CALL VAR BIN_OP VAR VAR NUMBER 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...
def sinput(): s = input().split() return int(s[0]), int(s[1]) n, w = sinput() s = input().split() s = [int(i) for i in s] s.sort() print(min(s[0] * 3 * n, s[n] * 3 / 2 * n, w))
FUNC_DEF ASSIGN VAR FUNC_CALL FUNC_CALL VAR RETURN FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER NUMBER VAR BIN_OP BIN_OP BIN_OP VAR 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...
import sys n, w = [int(i) for i in sys.stdin.readline().split()] teacups = sorted([int(i) for i in sys.stdin.readline().split()]) girl, boy = [teacups[0], teacups[n]] boy_ml = min(girl * 2, boy) girl_ml = boy_ml / 2 total = min(n * (boy_ml + girl_ml), w) print(total)
IMPORT 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 LIST VAR NUMBER VAR VAR ASSIGN VAR FUNC_CALL VAR BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL VAR BIN_OP VAR BIN_OP VAR VAR VAR EXPR 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...
def main(): n, w = list(map(int, input().split())) a = sorted(map(int, input().split())) print(min(w, min(a[0], a[n] * 0.5) * 3 * n)) def __starting_point(): main() __starting_point()
FUNC_DEF 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 FUNC_CALL VAR VAR BIN_OP BIN_OP FUNC_CALL VAR VAR NUMBER BIN_OP VAR VAR NUMBER NUMBER VAR FUNC_DEF EXPR FUNC_CALL 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())) can_pour_g = w / (3 * n) a = sorted(a)[::-1] b = a[:n] g = a[n:] mb = min(b) mg = min(g) pg = 0 if mb > mg * 2: pg = mg else: pg = mb / 2 if can_pour_g < pg: print(n * can_pour_g + 2 * n * can_pour_g) else: print(n * pg + 2 * n * pg)
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 VAR ASSIGN VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER 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...
n, w = map(int, input().split()) a = list(map(int, input().split())) a = sorted(a) result = 0 i = a[0] max_of_size_cup = a[n] if float(max_of_size_cup) / 2 <= i: result = max_of_size_cup * n + float(max_of_size_cup) / 2 * n else: while i >= 0: if i * 2 > max_of_size_cup: i = float(i) / 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 NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR IF BIN_OP FUNC_CALL VAR VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR BIN_OP BIN_OP FUNC_CALL VAR 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 = map(int, input().split(" ")) l = list(map(int, input().split(" "))) l = sorted(l) if l[0] * 2 >= l[int(len(l) / 2)]: if l[int(len(l) / 2)] >= w / 3 * 2 / n: print(w) else: print(l[int(len(l) / 2)] / 2 * n + l[int(len(l) / 2)] * n) else: v = w / 3 if l[0] >= v / n: print(w)...
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 NUMBER NUMBER VAR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR NUMBER IF VAR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR NUMBER BIN_OP BIN_OP BIN_OP 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 = map(int, input().split(" ")) a = list(map(int, input().split(" "))) a.sort(reverse=True) b = a[:n] g = a[n:] portion = min(b[-1], g[-1] * 2) s = portion * n + portion * n / 2 s = min(s, w) print(s)
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 NUMBER ASSIGN VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR BIN_OP BIN_OP VAR 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...
inp = input().split() n = int(inp[0]) w = int(inp[1]) cups = sorted(list(map(int, input().split()))) girl = cups[0] boy = cups[n] s = 0 s += min(girl, boy / 2) * 3 * n print(min(s, w))
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 VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR NUMBER VAR BIN_OP BIN_OP FUNC_CALL VAR VAR BIN_OP VAR NUMBER NUMBER VAR EXPR FUN...
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()) lst = [*map(float, input().split())] lst.sort() res = min(lst[0], lst[n] / 2, w / 3 / n) print(res * 3 * n)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST 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 BIN_OP VAR NUMBER VAR EXPR FUNC_CALL VAR BIN_OP 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...
def maximum_boiling(n, w, a): a.sort() girl_cup = a[0] boy_cup = a[n] base_cup = min(girl_cup, boy_cup / 2) return min(base_cup * 3 * n, w) def read_input(): n, w = [int(i) for i in input().split(" ")] a = [int(i) for i in input().split(" ")] return n, w, a def main(): n, w, a = ...
FUNC_DEF EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER RETURN FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER VAR VAR FUNC_DEF 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 RETURN 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()) cups = list(map(int, input().split())) cups.sort() boys_min = cups[n] girl_min = cups[0] tea = girl_min if boys_min < girl_min * 2: tea = boys_min / 2 if tea * 2 * n + tea * n > w: tea = w / (3 * n) print(tea * 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 VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR IF VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER IF BIN_OP BIN_OP BIN_OP VAR NUMBER VAR BIN_OP VAR VAR 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...
l2 = input().split() n = int(l2[0]) w = int(l2[1]) l = map(int, input().split()) l = sorted(l, reverse=True) minB = 2000000000 minG = 2000000000 for i in range(n): minB = min(minB, l[i]) minG = min(minB, l[i + n]) x = min(minB / 2, minG) print(min(w, n * x * 3))
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 VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR ASSIGN 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 = input().split() string = input() ints = map(int, string.split()) alist = [] for num in ints: alist.append(num) alist.sort() if alist[0] * 2 <= alist[int(n)]: g = alist[0] else: g = alist[int(n)] / 2 ans = 3.0 * float(n) * g if ans <= float(w): print(ans) else: print(w)
ASSIGN VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR IF BIN_OP VAR NUMBER NUMBER VAR FUNC_CALL VAR VAR ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP VAR FUNC_CALL VAR VAR NUMBER 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...
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 * 3 min_amount = min(float(smallest_cup_girl), smallest_cup_boy / 2) min_amount = min(min_amount, amount_of_tea / (3 * boy_...
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 VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR BIN_OP 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...
__author__ = "Andrey" n, w = map(int, input().split()) volumes = list(map(int, input().split())) volumes.sort() m = -1 if volumes[0] * 2 <= volumes[n]: possible = 3 * n * volumes[0] if possible <= w: m = max(m, possible) if volumes[n] / 2 <= volumes[0]: possible = volumes[n] / 2 * 3 * n if possi...
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 EXPR FUNC_CALL VAR ASSIGN VAR NUMBER IF BIN_OP VAR NUMBER NUMBER VAR VAR ASSIGN VAR BIN_OP BIN_OP NUMBER VAR VAR NUMBER IF VAR VAR ASSIGN VAR FUNC_CALL VAR 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()) capac = list(sorted(map(int, input().split()))) boy = capac[len(capac) // 2] girl = capac[0] print(min(3 * girl * n, 3 / 2 * boy * 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 ASSIGN VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER ASSIGN VAR VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR VAR BIN_OP BIN_OP BIN_OP NUMBER NUMBER 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()) array = [] for i in map(int, input().split()): array.append(i) array.sort() x = min(array[0], array[n] / 2) upperBound = w / (3 * n) if x > upperBound: x = upperBound ans = 3 * n * x print(ans)
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR BIN_OP NUMBER VAR IF VAR VAR ASSIGN VAR VAR ASSIGN VAR BIN_OP BIN_OP 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 = input().split() n = int(n) w = int(w) k = input().split() k = [int(x) for x in k] x = float(w) / float(3 * n) k.sort() if k[0] < x: x = k[0] if k[n] < 2 * x: x = float(k[n] / 2) ans = float(3 * n * x) print(ans)
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 ASSIGN VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR BIN_OP FUNC_CALL VAR VAR FUNC_CALL VAR BIN_OP NUMBER VAR EXPR FUNC_CALL VAR IF VAR NUMBER VAR ASSIGN VAR VAR NUMBER IF VAR VAR BIN_OP 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, m = map(int, input().split()) c = list(sorted(map(int, input().split()))) print(min(min(c[:n]) * n * 3, min(c[n : 2 * n]) / 2 * n * 3, m))
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 EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP FUNC_CALL VAR VAR VAR VAR NUMBER BIN_OP BIN_OP BIN_OP FUNC_CALL VAR VAR VAR BIN_OP NUMBER VAR NUMBER 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 = input().split() n = int(n) w = int(w) a = [0] * (2 * n) a = input().split() for i in range(2 * n): a[i] = int(a[i]) a.sort() print(min(a[0], a[n] / 2, w / 3 / n) * 3 * n)
ASSIGN VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST NUMBER BIN_OP NUMBER 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 EXPR FUNC_CALL VAR BIN_OP BIN_OP 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...
import sys [n, w], a = map(int, sys.stdin.readline().split()), sorted( map(int, sys.stdin.readline().split()) ) print(min(w / 3 / n, a[n] / 2, a[0]) * 3 * n)
IMPORT ASSIGN LIST VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER VAR BIN_OP VAR VAR NUMBER 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()) a = sorted(map(float, input().split())) print(min(a[0], a[n] / 2, w / 3 / n) * 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 BIN_OP BIN_OP FUNC_CALL VAR VAR NUMBER BIN_OP VAR VAR NUMBER BIN_OP BIN_OP VAR NUMBER 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()) a = [int(x) for x in input().split()] a.sort() x = a[0] y = a[n] if x * 2 >= y: print(min(w, y / 2 * 3 * n)) exit() print(min(w, x * 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 VAR NUMBER ASSIGN VAR VAR VAR IF BIN_OP VAR NUMBER VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP BIN_OP BIN_OP VAR NUMBER NUMBER VAR EXPR FUNC_CALL 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 = list(map(int, input().split())) a = list(map(int, input().split())) a.sort() maxx = w / (3 * n) t = 0 if a[n] / 2 > a[0]: t = a[0] else: t = a[n] / 2 if t > maxx: print(w) else: print(t * 3 * 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 BIN_OP VAR BIN_OP NUMBER VAR ASSIGN VAR NUMBER IF BIN_OP VAR VAR NUMBER VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR NUMBER IF 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()) arr = list(map(int, input().split())) arr.sort() res = 0 x_min = 0 if arr[0] * 2 <= arr[n]: x_min = float(arr[0]) else: x_min = float(arr[n] / 2) if x_min * 3 * n <= w: res = float(x_min * 3 * n) else: res = float(w) if res % 1 != 0.0: print(res) else: print(int(...
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 NUMBER IF BIN_OP VAR NUMBER NUMBER VAR VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR BIN_OP VAR VAR NUMBER IF 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...
I = lambda: map(int, input().split()) n, w = I() a = sorted(I()) t = min(a[0] * 2, a[n]) print(min(t * n * 3 / 2, w))
ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP 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...
def max_water(friends, w, cups): heso1 = w / (3 * friends) cups.sort() heso2_girl = cups[0] heso3_boy = cups[friends] / 2 min_water = min(heso1, heso2_girl, heso3_boy) return min_water * 3 * friends friends, w = list(map(int, input().split())) cups = list(map(int, input().split())) print(max_w...
FUNC_DEF ASSIGN VAR BIN_OP VAR BIN_OP NUMBER VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR VAR RETURN BIN_OP BIN_OP VAR NUMBER VAR 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 ...
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()) read = list(map(int, input().split())) read.sort(reverse=True) a = [] b = [] for i in range(n): a.append(read[i]) b.append(read[i + n]) c = [] for i in range(n): c.append(min(a[i] / 2, b[i])) print(min(w, min(c) * 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 NUMBER ASSIGN VAR LIST ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR VAR BIN_OP VAR VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR 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...
n, w = map(int, input().split()) a = list(map(int, input().split())) b = sorted(a) b1 = b[0:n] b2 = b[n : 2 * n] maxGirl = b1[0] maxBoy = b2[0] maxWater = w / 3 / n maxCapity = 0 total = 0 if maxGirl * 2 > maxBoy: maxCapity = maxBoy / 2 else: maxCapity = maxGirl if maxWater > maxCapity: total = maxCapity * ...
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 NUMBER VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR ASSIGN VAR NUMBER 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...
s = [int(x) for x in input().split(" ")] n, pot = s[0], s[1] cups = sorted([int(x) for x in input().split(" ")])[::-1] for i in range(0, len(cups) // 2): cups[i] = cups[i] / 2 l = len(cups) min_cup = min(cups) y = min_cup * n * 3 print(y if y < pot else pot)
ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR VAR VAR NUMBER VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP FUNC_CALL VAR VAR NUMBER ASSIGN VAR VAR BIN_OP VAR VAR NUMBER ASSIGN VAR 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...
A = input().split() B = input().split() a = [int(x) for x in list(B)] a.sort() dt = min(a[0], a[int(A[0])] / 2) * 3 * int(A[0]) print(min(dt, int(A[1])))
ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP FUNC_CALL VAR VAR NUMBER BIN_OP VAR FUNC_CALL VAR VAR NUMBER NUMBER NUMBER FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR 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 = sorted([int(x) for x in input().split()]) girl = cups[0] boys = cups[n] both = min(girl, boys / 2) print(min(n * both + 2 * n * both, w))
ASSIGN VAR VAR FUNC_CALL 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 EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR BIN_OP BIN_OP NUMBER 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...
R = lambda: list(map(int, input().split())) n, w = R() l = R() l.sort() M = l[n] m = l[0] if l[n] > 2 * l[0]: print(min(3 * m * n, w)) else: print(min(1.5 * M * n, w))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR NUMBER IF VAR VAR BIN_OP NUMBER VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR VAR VAR EXPR FUNC_CALL VAR 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...
n, w = [int(i) for i in input().split()] a = [int(i) for i in input().split()] a.sort() l = len(a) i, j = 0, int(l / 2) if a[i] * 2 <= a[j] and a[j] / 2.0 <= a[i]: print(min(max(a[i], a[j] / 2.0) * 3 * n, w)) elif a[i] * 2 <= a[j]: print(min(a[i] * 3 * n, w)) elif a[j] / 2.0 <= a[i]: print(min(a[j] / 2 * 3 ...
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 VAR ASSIGN VAR VAR NUMBER FUNC_CALL VAR BIN_OP VAR NUMBER IF BIN_OP VAR VAR NUMBER VAR VAR BIN_OP VAR VAR NUMBER VAR VAR EXPR FUNC_CALL VAR 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...
n, k = map(int, input().split()) l = list(map(int, input().split())) l.sort() x = n * 3 * l[0] y = n * 3 * l[n] / 2 print(min(min(x, y), k))
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 BIN_OP VAR NUMBER VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL 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 = list(map(int, input().split())) a = list(map(int, input().split())) a.sort() v1 = a[0] v2 = a[n] q = min(v1, v2 / 2) print(min(w, q * n * 3))
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 ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR 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.sort() bigCup = max(a) def check(x): agar = x / (2 * n * 3) for_girl = agar * 2 for_boy = for_girl * 2 if a[0] < for_girl or a[n] < for_boy: return False return True right = w left = 0 mid = (left + right) / 2 while l...
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 FUNC_DEF ASSIGN VAR BIN_OP VAR BIN_OP BIN_OP NUMBER VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER IF VAR NUMBER VAR VAR 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...
(*a,) = map(int, input().split()) (*b,) = sorted(map(int, input().split())) c = min(b[0], b[a[0]] / 2, a[1] / a[0] / 3) print(c * a[0] * 3)
ASSIGN 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 BIN_OP VAR VAR NUMBER NUMBER BIN_OP BIN_OP VAR NUMBER VAR NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP 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...
inp = lambda: map(int, input().split()) n, w = inp() a = sorted([*inp()]) print(min(w, min(a[n] / 2, a[0]) * n * 3))
ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR LIST FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP BIN_OP FUNC_CALL VAR BIN_OP VAR VAR NUMBER VAR NUMBER 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.sort() mina = a[n] maxa = a[0] ans = min(mina / 2.0, maxa) ans = 3.0 * n * ans ans = min(ans, w * 1.0) 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 VAR ASSIGN VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP NUMBER VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER EX...
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(i) for i in input().split(" ")] a = [int(i) for i in input().split(" ")] a = sorted(a) x = w / (3 * n) if x <= a[0] and 2 * x <= a[n]: print(w) else: print(3 * min(a[0], a[n] / 2) * n) main()
FUNC_DEF 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 ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP NUMBER VAR IF VAR VAR NUMBER BIN_OP NUMBER VAR VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP NUMBER FUN...
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 a[0] >= a[n] / 2: m = a[n] * n + a[n] * n / 2 else: m = a[0] * n + a[0] * n * 2 if m > w: print(w) else: print(m)
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 NUMBER BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR BIN_OP BIN_OP VAR VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR BIN_OP BIN_OP VAR NUMBER VAR NU...