description
stringlengths
171
4k
code
stringlengths
94
3.98k
normalized_code
stringlengths
57
4.99k
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) A = sorted(list(map(int, input().split()))) list.reverse(A) Sum = 0.0 Ans = 0.0 for i in range(n): Sum += A[i] t = n - i - 1 if m >= n - i - 1: Ans = max(Ans, (Sum + min(m - t, (i + 1) * k)) / (i + 1)) print(Ans)
ASSIGN VAR 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 VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER IF VAR BIN_OP BIN_OP VAR VAR NUMBER ASSIG...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = list(map(int, input().split())) a.sort() total = sum(a) avgs = [] for i in range(0, n): remain = max(m - i, 0) ln = n - i each = remain // ln sm = 0 if each >= k: sm = total / ln + k else: sm = (total + remain) / ln avgs.append(sm) ...
ASSIGN VAR 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 LIST FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR FUNC_CALL VAR BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP VAR ...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = [int(i) for i in input().split()] a.sort(reverse=True) max_avg = 0 total = sum(a) while n > 0 and m > -1: tmp = (total + min(n * k, m)) / n if max_avg < tmp: max_avg = tmp total -= a.pop() n -= 1 m -= 1 print(max_avg)
ASSIGN VAR 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 NUMBER ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR WHILE VAR NUMBER VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR FUNC_CALL VAR BIN_OP VAR VAR VAR VAR IF VAR VAR ASSIGN VAR VAR VAR FUNC_...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
num_heros, opt_ph, tot_opt = map(int, input().split(" ")) pList = list(map(int, input().split(" "))) pList = sorted(pList) pLen = len(pList) tot_sum = sum(pList) max_val = 0 x = 0 while x < pLen and x <= tot_opt: val = (tot_sum + min(tot_opt - x, (pLen - x) * opt_ph)) / (pLen - x) if val > max_val: max_...
ASSIGN VAR 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 ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER WHILE VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR FUNC...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = list(map(int, input().split())) Sum = sum(a) max_avg = Sum / n a = sorted(a) if m > n: if m - n >= k and max_avg < a[-1] + k: max_avg = a[-1] + k else: max_avg = a[-1] + m - n + 1 elif m == n: if max_avg < a[-1] + 1: max_avg = a[-1] + 1 else: ...
ASSIGN VAR 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 BIN_OP VAR VAR ASSIGN VAR FUNC_CALL VAR VAR IF VAR VAR IF BIN_OP VAR VAR VAR VAR BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_O...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
[n, k, m] = [int(x) for x in input().split()] a = [int(x) for x in input().split()] a.sort() s = sum(a) res = [(s + min(n * k, m)) / n] for i in range(1, n): s -= a[i - 1] if m < i: break res.append((s + min(m - i, (n - i) * k)) / (n - i)) print(max(res))
ASSIGN LIST VAR 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 LIST BIN_OP BIN_OP VAR FUNC_CALL VAR BIN_OP VAR VAR VAR VAR FOR VAR FUNC_CALL VAR NUMBER VAR VAR VAR BIN_OP VAR NUMBER IF VAR VAR EXPR...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) l = list(map(int, input().split())) l.sort() l.reverse() if m > n - 1: print(l[0] + min(m - (n - 1), k)) else: sum = l[0] for i in range(1, n - m): sum += l[i] ans = sum / (n - m) j = 1 for i in range(n - m, n): sum += l[i] if ans < (su...
ASSIGN VAR 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 IF VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR NUMBER FUNC_CALL VAR BIN_OP VAR BIN_OP VAR NUMBER VAR ASSIGN VAR VAR NUMBER FOR VAR FUNC_CALL VAR N...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = list(map(int, input().split())) ai = list(map(int, input().split())) ai.sort() n2 = n num = sum(ai) ans = 0.0 i = 0 while n2 > 0 and m > -1: num2 = (num + min(m, n2 * k)) / n2 ans = max(ans, num2) num -= ai[i] i += 1 n2 -= 1 m -= 1 print(ans)
ASSIGN VAR 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 ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER WHILE VAR NUMBER VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR FUNC_CALL VAR VAR BIN_...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
import sys def max_average(H, N, K, M): def prefix_sum(): presum = [0] s = 0 for e in H: s = s + e presum.append(s) return presum SH = prefix_sum() avgs = [ ((SH[N] - SH[i] + min(M - i, K * (N - i))) / (N - i)) for i in range(min(M ...
IMPORT FUNC_DEF FUNC_DEF ASSIGN VAR LIST NUMBER ASSIGN VAR NUMBER FOR VAR VAR ASSIGN VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR VAR RETURN VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR FUNC_CALL VAR BIN_OP VAR VAR BIN_OP VAR BIN_OP VAR VAR BIN_OP VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR BIN_OP ...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
a = [int(i) for i in input().split()] n = a[0] k = a[1] m = a[2] a = [int(i) for i in input().split()] sum_a = sum(a) def boost(q, energy): max_boost = energy if max_boost > k * q: max_boost = k * q return max_boost max_boost = boost(n, m) average = (sum_a + max_boost) / n people = n energy = m ...
ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_DEF ASSIGN VAR VAR IF VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP VAR VAR RETURN VAR ASSIGN VAR FUNC_CALL VAR VAR...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
import sys input = sys.stdin.readline def main(): n, k, m = map(int, input().split()) a = list(map(int, input().split())) a.sort() if m == 1 and m != n: return max(sum(a[m:]) / (n - m), (sum(a) + 1) / n) if m > n: m -= n - 1 return max(a) + min(k, m) if m == n: ...
IMPORT ASSIGN VAR VAR FUNC_DEF ASSIGN VAR 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 VAR VAR RETURN FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR VAR BIN_OP VAR VAR BIN_OP BIN_OP FUNC_CALL VAR VAR NUMBER VAR IF VAR VAR V...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
def superhero_problem(): n, k, m = input().split(" ") tmp = input().split(" ") n, k, m = int(n), int(k), int(m) sum = 0 for i, _ in enumerate(tmp): tmp[i] = int(tmp[i]) sum += tmp[i] tmp = sorted(tmp) a = [0] a.extend(tmp) answer = (sum + min(n * k, m)) / n for i ...
FUNC_DEF ASSIGN VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL VAR VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER FOR VAR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR LIST NUMB...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = list(map(int, input().split())) a.sort() r = min(m, n - 1) s = sum(a) ans = (s + min(m, k * n)) / n for i in range(0, r): s -= a[i] t = (s + min(m - i - 1, k * (n - i - 1))) / (n - i - 1) ans = max(t, ans) print(ans)
ASSIGN VAR 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 BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR FUNC_CALL VAR VAR BIN_OP VAR VAR VAR FOR VAR FUNC_CALL VAR NUMBER VA...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) lst = [*map(int, input().split())] summa = sum(lst) res = 0 lst.sort() for i, x in enumerate(lst): if m < 0: break new = (summa + min(n * k, m)) / n summa -= x n -= 1 m -= 1 if new < res: break res = new print(res)
ASSIGN VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER EXPR FUNC_CALL VAR FOR VAR VAR FUNC_CALL VAR VAR IF VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR FUNC_CALL VAR BIN_OP VAR VAR VAR VAR VAR VAR VAR NUMBER VAR NU...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
def get(): return list(map(int, input().split())) n, k, m = get() a = get() a.sort() c = (n + 1) * [0] c[0] = 0 for i in range(1, n + 1): c[i] = c[i - 1] + a[i - 1] f = (c[n] - c[0] + min(m, n * k)) / n for i in range(1, n): if m - i >= 0: f = max((c[n] - c[i] + min(m - i, (n - i) * k)) / (n - i),...
FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER LIST NUMBER ASSIGN VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR VAR BIN_OP VAR BIN_OP VAR NUMBER VAR BIN...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) l = list(map(int, input().split())) l.sort() suml = sum(l) mean = 0 if n * k > m: maxIncrease = m else: maxIncrease = n * k mean = (suml + maxIncrease) / n sumP = suml maxIncrease = 0 for i in range(1, min(n - 1, m) + 1): if (n - i) * k > m - i: maxIncrease = m - ...
ASSIGN VAR 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 NUMBER IF BIN_OP VAR VAR VAR ASSIGN VAR VAR ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR VAR ASSIGN VAR ...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) s = [int(x) for x in input().split()] S = sorted(s) S = S[::-1] dp = [S[0]] for i in range(1, len(s)): dp.append(dp[-1] + S[i]) dp = dp[::-1] br = len(dp) for i in range(0, len(dp)): if i <= m: dp[i] = dp[i] + min(m - i, (n - i) * k) else: br = i b...
ASSIGN VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR NUMBER ASSIGN VAR LIST VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR NUMBER VAR VAR ASSIGN VAR VAR NUMBER ASSIGN VAR...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = [int(x) for x in input().split(" ")] s = [int(x) for x in input().split(" ")] res = 0 somme = 0 s.sort(reverse=True) j = m while len(s) > 1 and j > 0 and (s[0] - s[-1] > 1 or j > len(s)): s.pop() j = j - 1 x1 = s.count(max(s)) x2 = s.count(min(s)) if x1 >= x2 and max(s) - min(s) != 0 and j > 0: s....
ASSIGN VAR 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 NUMBER ASSIGN VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR VAR WHILE FUNC_CALL VAR VAR NUMBER VAR NUMBER BIN_OP VAR NUMBER VAR NUMBER NUMBER VAR FUNC_CALL VAR VAR EXPR FU...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) arr = list(map(int, input().split())) arr.sort() sm = 0 ans = 0 for i in range(len(arr) - 1, -1, -1): sm += arr[i] if i <= m: sm += min(k * (n - i), m - i) ans = max(ans, sm / (n - i)) sm -= min(k * (n - i), m - i) print(ans)
ASSIGN VAR 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 FOR VAR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR NUMBER NUMBER NUMBER VAR VAR VAR IF VAR VAR VAR FUNC_CALL VAR BIN_OP VAR BIN_OP VAR VAR BI...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
def main(): n, k, m = map(int, input().split()) heroes = [x for x in map(int, input().split())] heroes.sort() cbk = min(m, n) m -= cbk for i in range(cbk): heroes[i] += 1 heroes.reverse() for i in range(n): used = min(m, k - 1) heroes[i] += used m -= used ...
FUNC_DEF ASSIGN VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR VAR FOR VAR FUNC_CALL VAR VAR VAR VAR NUMBER EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR NUM...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = list(map(int, input().split())) s = 0 for i in a: s += i a = sorted(a) ans = (s + min(n * k, m)) / n p = n for i in range(n - 1): s -= a[i] m -= 1 p -= 1 ans = max(ans, (s + min(p * k, m)) / p) if m == 0: break print("%.10f" % ans)
ASSIGN VAR 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 FOR VAR VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR FUNC_CALL VAR BIN_OP VAR VAR VAR VAR ASSIGN VAR VAR FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER VAR ...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = input().split() n = int(n) k = int(k) m = int(m) a = input().split() s = 0 for i in range(len(a)): a[i] = int(a[i]) s += a[i] a.sort() ans = (s + min(k * n, m)) / n for i in range(n - 1): if i == m: break s -= a[i] ans = max(ans, (s + min(k * (n - i - 1), m - i - 1)) / (n - i - 1))...
ASSIGN VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP VAR ...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
from sys import stdin n, m, k = list(map(int, stdin.readline().strip().split())) s = list(map(int, stdin.readline().strip().split())) s.sort() acum = [0] for i in range(n - 1, -1, -1): acum.append(acum[-1] + s[i]) acum.reverse() acum.pop() y = min(n * m, k) ans = (sum(s) + y) / n for i in range(min(n - 1, k)): ...
ASSIGN VAR 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 EXPR FUNC_CALL VAR ASSIGN VAR LIST NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP VAR NUMBER VAR VAR EXPR FUNC_CALL VA...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
nheroes, ninc, nops = map(int, input().split()) pows = [p for p in map(float, input().split())] total_pow = sum(pows) max_avg = float("-inf") pows.sort() for i in range(min(nheroes, nops)): max_inc = min(nheroes * ninc, nops - i) new_max = (total_pow + max_inc) / nheroes max_avg = max(max_avg, new_max) ...
ASSIGN VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL VAR BIN_OP VAR VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP B...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
def __solve__(): a = input().split() n = int(a[0]) k = int(a[1]) m = int(a[2]) a = input().split() i = 0 sum = 0 for j in range(n): a[i] = int(a[i]) sum += a[i] i += 1 a.sort(key=None, reverse=False) res = sum / n cnt = min(n - 1, m) for j in range...
FUNC_DEF 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 NUMBER ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR VAR VAR VAR VAR NUMBER EXPR FUNC_C...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
def my_min(x, y): if x > y: return y return x def my_max(x, y): if x > y: return x return y input1 = input().split(" ") a = input().split(" ") n = int(input1[0]) k = int(input1[1]) m = int(input1[2]) Sum = 0 a_l = len(a) for i in range(a_l): a[i] = int(a[i]) Sum += a[i] a.sor...
FUNC_DEF IF VAR VAR RETURN VAR RETURN VAR FUNC_DEF IF VAR VAR RETURN VAR RETURN VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR V...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) s = r = 0 a = list(map(int, input().split())) a.sort() if m >= n: print(a[n - 1] + min(m - n + 1, k)) else: for i in range(0, n): s += a[i] s += m r = s / n for i in range(0, m): r = max(r, (s - a[i] - i - 1) / (n - i - 1)) s -= a[i] pr...
ASSIGN VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR IF VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR BIN_OP VAR NUMBER FUNC_CALL VAR BIN_OP BIN_OP VAR VAR NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER VAR VAR VAR VAR ...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) A = sorted(list(map(int, input().split()))) sum_ = sum(A) res = (sum(A) + min(m, n * k)) / n for i in range(min(m, n - 1)): sum_ -= A[i] min_ = min(m - 1, (n - i - 1) * k) res = max(res, (sum_ + min_) / (n - i - 1)) m -= 1 print(res)
ASSIGN VAR 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 VAR ASSIGN VAR BIN_OP BIN_OP FUNC_CALL VAR VAR FUNC_CALL VAR VAR BIN_OP VAR VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER VAR VAR VAR...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = list(map(int, input().split())) a.sort() sumi = sum(a) ans = sumi / n ct = 0 add = min(k * n, m - ct) ans = max(ans, (sumi + add) / n) for i in a: sumi -= i ct += 1 n -= 1 if ct > m or n == 0: break add = min(k * n, m - ct) ans = max(ans, (sumi + a...
ASSIGN VAR 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 BIN_OP VAR VAR ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR BIN_OP VAR VAR BIN_OP VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP BIN_OP VA...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
input1 = input().split(" ") input2 = input().split(" ") member = int(input1[0]) limit = int(input1[1]) operation = int(input1[2]) power = [] for i in range(member): power.append(int(input2[i])) power.sort() Sum = sum(power) maximum = (Sum + (limit * member if limit * member < operation else operation)) / member for...
ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR V...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
import sys n, k, m = [int(tmp) for tmp in sys.stdin.readline().split()] a = [int(tmp) for tmp in sys.stdin.readline().split()] a.sort(reverse=True) sa = sum(a) mr = m nr = n sar = sa while nr >= 2 and mr != 0: avsidau = (sar - a[nr - 1] + min([mr - 1, (nr - 1) * k])) / (nr - 1) avsiu = (sar + min([nr * k, mr])...
IMPORT ASSIGN VAR 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 VAR ASSIGN VAR VAR ASSIGN VAR VAR ASSIGN VAR VAR WHILE VAR NUMBER VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR BIN_OP VAR NUMBER FUNC_...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = list(map(int, input().split())) a = sorted(list(map(int, input().split()))) sm = 0 cl = [0] for x in a: sm += x cl.append(sm) def func(i): return (cl[-1] - cl[i] + min(k * (n - i), m - i)) / (n - i) mx = 0 for i in range(min(n - 1, m) + 1): res = func(i) if res > mx: mx = res p...
ASSIGN VAR VAR 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 FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR LIST NUMBER FOR VAR VAR VAR VAR EXPR FUNC_CALL VAR VAR FUNC_DEF RETURN BIN_OP BIN_OP BIN_OP VAR NUMBER VAR VAR FUNC_CALL VAR BIN_OP VAR...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = list(map(int, input().split())) a.sort() sm = sum(a) ans = (sm + min(n * k, m)) / n i = 0 while True: if i == n - 1 or i == m: break sm -= a[i] tans = (sm + min(m - i - 1, (n - i - 1) * k)) / (n - i - 1) if tans < ans: break ans = tans i +=...
ASSIGN VAR 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 BIN_OP BIN_OP VAR FUNC_CALL VAR BIN_OP VAR VAR VAR VAR ASSIGN VAR NUMBER WHILE NUMBER IF VAR BIN_OP VAR NUMBER VAR VAR VAR VAR VAR AS...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = list(map(int, input().split())) a.sort() d = [0] for i in range(n): d.append(d[-1] + a[i]) ans = d[n] / n for i in range(min(n, m + 1)): ans = max(ans, (d[n] - d[i] + min((n - i) * k, m - i)) / (n - i)) print(ans)
ASSIGN VAR 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 NUMBER FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR NUMBER VAR VAR ASSIGN VAR BIN_OP VAR VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP VA...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
read = lambda: map(int, input().split()) n, k, m = read() a = list(read()) a.sort() x = sum(a) suma = [x] for i in range(min(m, n - 1)): x -= a[i] suma.append(x) mm = 0 for cnt, i in enumerate(suma): mm = max(mm, (i + min(m - cnt, k * (n - cnt))) / (n - cnt)) print("%.10f" % mm)
ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR LIST VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER VAR VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR NUMBER FOR VAR VAR FUNC...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = [int(x) for x in input().split()] a = [int(x) for x in input().split()] a.sort(reverse=True) for i in range(1, len(a)): a[i] += a[i - 1] for i in range(n): if n - 1 - i <= m: a[i] = float(a[i] + min(m - (n - 1 - i), k * (i + 1))) / (i + 1) print(max(a[max(n - 1 - m, 0) :]))
ASSIGN VAR 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 FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR VAR VAR VAR BIN_OP VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF BIN_OP BIN_OP VAR NUMBER VAR VAR ASSIGN VAR VAR BIN_OP FUNC_CALL V...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = sorted(list(map(int, input().split()))) s = sum(a) ans = -1 for i in range(min(n, m + 1)): avg = (s + min(k * (n - i), m - i)) / (n - i) ans = max(avg, ans) s -= a[0] del a[0] print(ans)
ASSIGN VAR 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 VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR FUNC_CALL VAR BIN_OP VAR BIN_OP VAR VAR BIN_...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
def check(sumPower, heroesAmount, operations, k): return (sumPower + min(heroesAmount * k, operations)) / heroesAmount def maxPower(): n, k, m = map(int, input().split()) if n == 0: print(0.0) return array = sorted(list(map(int, input().split()))) sumPower = 0 heroesAmount = n ...
FUNC_DEF RETURN BIN_OP BIN_OP VAR FUNC_CALL VAR BIN_OP VAR VAR VAR VAR FUNC_DEF ASSIGN VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER RETURN ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR VAR FOR VAR VAR VAR VA...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) l = list(map(int, input().split())) l.sort() sum = 0 for i in l: sum += i if n * k < m: avg, i = (sum + n * k) / n, 0 else: avg, i = (sum + m) / n, 0 while m and n != 1: m = m - 1 n = n - 1 if n * k < m: temp = (sum - l[i] + n * k) / n sum = su...
ASSIGN VAR 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 FOR VAR VAR VAR VAR IF BIN_OP VAR VAR VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR VAR VAR NUMBER ASSIGN VAR VAR BIN_OP BIN_OP VAR VAR VAR NUMBER WHILE ...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = [int(i) for i in input().split()] a = [int(i) for i in input().split()] a.sort(reverse=True) l = min(a) s = sum(a) max_s = 0 while m > 0 and a: max_s = max((s + min(m, k * len(a))) / len(a), max_s) s -= a.pop() m -= 1 if a: max_s = max((s + min(m, k * len(a))) / len(a), max_s) print(max_s)
ASSIGN VAR 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 VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER WHILE VAR NUMBER VAR ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP VAR FUNC_CALL VAR VAR BIN_OP VAR FUN...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) ls = sorted(list(map(int, input().split())), reverse=True) s = sum(ls) avg = (min(len(ls) * k, m) + s) / len(ls) while len(ls) > 1 and m > 0: s -= ls.pop(-1) m -= 1 z = (min(len(ls) * k, m) + s) / len(ls) if z > avg: avg = z print(avg)
ASSIGN VAR 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 NUMBER ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR VAR VAR VAR FUNC_CALL VAR VAR WHILE FUNC_CALL VAR VAR NUMBER VAR NUMBER VAR FU...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = list(map(int, input().split())) a = list(map(int, input().split())) a = list(sorted(a)) s = [0] * n s[0] = a[0] for i in range(1, n): s[i] = s[i - 1] + a[i] S = s[n - 1] R = (S + min(k * n, m)) / n for i in range(min(m, n - 1)): S = s[n - 1] - s[i] R = max((S + min(m - i - 1, k * (n - i - 1))) / (...
ASSIGN VAR 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 ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR NUMBER VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR BIN_OP VAR BIN_OP VAR NU...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = list(map(int, input().split())) s = sum(a) a.sort() i = 0 max_s = (s + min(m, n * k)) / n while m > 0 and i < n - 1: s -= a[i] m -= 1 i += 1 max_s = max(max_s, (s + min(m, (n - i) * k)) / (n - i)) print(max_s)
ASSIGN VAR 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 NUMBER ASSIGN VAR BIN_OP BIN_OP VAR FUNC_CALL VAR VAR BIN_OP VAR VAR VAR WHILE VAR NUMBER VAR BIN_OP VAR NUMBER VAR VAR VAR VAR NUMBE...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = list(sorted(map(int, input().split()), reverse=True)) best_avg = 0 s = sum(a) for i in range(len(a)): if i > m: break if i > 0: s -= a[-i] best_avg = max(best_avg, (s + min((len(a) - i) * k, m - i)) / (len(a) - i)) print(best_avg)
ASSIGN VAR 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 NUMBER ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR IF VAR NUMBER VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP BIN_OP VAR ...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
import sys input = sys.stdin.readline n, k, m = map(int, input().split()) A = list(map(int, input().split())) A.sort() SUM = sum(A) ANS = 0 for i in range(min(n, m + 1)): MPOWER = SUM + min(m - i, (n - i) * k) ANS = max(ANS, MPOWER / (n - i)) SUM -= A[i] print(ANS)
IMPORT ASSIGN VAR VAR ASSIGN VAR 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 NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR FUNC_CALL VAR BIN_OP VAR...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
def operation(a, last_index, sum_before_last_index, operation_index): if last_index == 0: a[0] += 1 return last_index, sum_before_last_index if sum_before_last_index >= last_index * (a[last_index] + 1): return last_index - 1, sum_before_last_index - a[last_index - 1] else: a[...
FUNC_DEF IF VAR NUMBER VAR NUMBER NUMBER RETURN VAR VAR IF VAR BIN_OP VAR BIN_OP VAR VAR NUMBER RETURN BIN_OP VAR NUMBER BIN_OP VAR VAR BIN_OP VAR NUMBER VAR VAR NUMBER RETURN VAR VAR FUNC_DEF IF VAR NUMBER RETURN BIN_OP VAR NUMBER FUNC_CALL VAR VAR VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR ASSI...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = list(map(int, input().split())) a = [int(x) for x in input().split()] a.sort(reverse=True) ans = 0 s = 0 for i in range(n): s += a[i] if n - i - 1 > m: continue ans = max(ans, float((s + min(m - (n - i - 1), (i + 1) * k)) / (i + 1))) print(ans)
ASSIGN VAR VAR VAR FUNC_CALL 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 NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR VAR VAR VAR IF BIN_OP BIN_OP VAR VAR NUMBER VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL VAR BIN_OP BI...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = list(map(int, input().split())) a.sort() for i in range(n - 2, -1, -1): a[i] = a[i] + a[i + 1] max_num = (a[0] + min(k * n, m)) / n for i in range(1, n): if i > m: break res = (a[i] + min((n - i) * k, m - i)) / (n - i) max_num = max(max_num, res) print(max...
ASSIGN VAR 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 FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR VAR BIN_OP VAR VAR VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER FUNC_CALL VAR BIN_OP VAR VAR VA...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) v = list(map(int, input().split())) r = s = i = 0 for x in reversed(sorted(v)): i += 1 s += x if n - i <= m: r = max(r, (s + min(k * i, m - n + i)) / i) print(r)
ASSIGN VAR 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 FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR NUMBER VAR VAR IF BIN_OP VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP BIN_OP VAR FUNC_CALL VAR BIN_OP VAR VAR BIN_OP BI...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
import sys n, k, m = [int(i) for i in input().split(" ")] def helper(pows, k, m): res = -sys.maxsize pref = [0] for i in range(len(pows)): pref.append(pref[-1] + pows[i]) if len(pows) == 1: return pows[0] + k for i in range(min(len(pows), m + 1)): total = m - i if ...
IMPORT ASSIGN VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING FUNC_DEF ASSIGN VAR VAR ASSIGN VAR LIST NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR NUMBER VAR VAR IF FUNC_CALL VAR VAR NUMBER RETURN BIN_OP VAR NUMBER VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VA...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
from sys import stdin n, k, m = map(int, input().split()) l = list(map(int, stdin.readline().split())) l.sort() l1 = [] sm = 0 for i in l: sm += i l1.append(sm) l2 = [] for i in range(0, min(n - 1, m)): l2.append((l1[-1] - l1[i] + min(k * (n - i - 1), m - i - 1)) / (n - i - 1)) l2.append((sum(l) + min(n * ...
ASSIGN VAR 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 NUMBER FOR VAR VAR VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR BIN_OP VAR NUMBER VAR EXPR FUNC_CALL ...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) arr = list(map(int, input().split())) arr.sort() s = sum(arr) mx = s / n + min(m, n * k) / n for i in range(n - 1): remain = m - i - 1 val = (s - arr[i]) / (n - (i + 1)) + min(remain, (n - i - 1) * k) / (n - i - 1) s -= arr[i] if val > mx: mx = val if rema...
ASSIGN VAR 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 BIN_OP BIN_OP VAR VAR BIN_OP FUNC_CALL VAR VAR BIN_OP VAR VAR VAR FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VA...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = [int(s) for s in input().split()] a.sort() q = sum(a) ans = 0 for i in range(min(n, m + 1)): if m - i >= (n - i) * k: ans = max(ans, (q + (n - i) * k) / (n - i)) else: ans = max(ans, (q + m - i) / (n - i)) q -= a[i] print(ans)
ASSIGN VAR 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 FUNC_CALL VAR VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER IF BIN_OP VAR VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_O...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse=True) if n == 1: print(a[0] + min(m, k)) exit() pr = [(0) for i in range(n + 1)] pr[0] = 0 mx = 0 eps = 1e-07 for i in range(1, n + 1): pr[i] = pr[i - 1] + a[i - 1] for c in range(max(n - m, 1), n + 1): l = n - c ...
ASSIGN VAR 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 IF VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR NUMBER FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER VAR FUNC_CALL VAR BIN_OP VAR NUMBER ASSIGN VAR NUMBER NU...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = list(map(int, input().split())) a = sorted(map(int, input().split())) res = 0 sm = sum(a) for ai in a: if m < 0: break if m < k * n: alt = (sm + m) / n else: alt = sm / n + k res = max(res, alt) n -= 1 m -= 1 sm -= ai print(res)
ASSIGN VAR 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 NUMBER ASSIGN VAR FUNC_CALL VAR VAR FOR VAR VAR IF VAR NUMBER IF VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VA...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
vals = [int(r) for r in input().split()] n = vals[0] k = vals[1] m = vals[2] powers = sorted([int(r) for r in input().split()], reverse=True) ans = 0 curr_sum = 0 for i in range(n): curr_sum += powers[i] if n - 1 - i > m: continue else: moves_left = m - (n - 1 - i) ppl_left = i + 1 ...
ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR VAR VAR VAR IF BIN_OP BIN_OP VAR NUMBER VAR VAR ASSIGN VA...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = list(map(int, input().split())) a = sorted(a) s = sum(a) if m <= k * n: ans = (s + m) / n else: ans = (s + k * n) / n for i in range(min(n - 1, m)): s = s - a[i] m -= 1 if m <= k * (n - i - 1): t = (s + m) / (n - i - 1) else: t = (s + k * (...
ASSIGN VAR 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 IF VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP VAR VAR VAR FOR VAR FUNC_CALL VAR FUNC_...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n_super, max_increase, max_op = list(map(int, input().strip().split())) powers = list(map(int, input().strip().split())) powers = sorted(powers) curr_sum = sum(powers) best_score = float("-inf") for idx in range(n_super): n_remaining_hero = n_super - idx n_remaining_actions = max_op - idx if n_remaining_act...
ASSIGN VAR 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 FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR STRING FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR BIN_O...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = [int(x) for x in input().split()] L = [int(x) for x in input().split()] L.sort(reverse=True) T = [0] for i in range(n): T.append(T[-1] + L[i]) best = 0 for i in range(1, n + 1): if n - i <= m: best = max(best, (T[i] + min(m - n + i, k * i)) / i) print(best)
ASSIGN VAR 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 LIST NUMBER FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR NUMBER VAR VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER IF BIN_OP VAR...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = list(map(int, input().split())) a.sort() ans = sum(a) / n cm = [a[0]] for i in range(1, n): cm.append(cm[-1] + a[i]) cm.append(0) for d in range(min(n, m + 1)): nb = min((m - d) // k, n - d) r = (m - d) % k if nb < n - d else 0 ans = max(ans, (cm[-2] - cm[d - 1] +...
ASSIGN VAR 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 FUNC_CALL VAR VAR VAR ASSIGN VAR LIST VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR EXPR FUNC_CALL VAR BIN_OP VAR NUMBER VAR VAR EXPR FUNC_CALL VAR NUMBER FO...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, m, k = [int(x) for x in input().split()] sup = [int(x) for x in input().split()] summa = 0 sup.sort() total = [] counter = len(sup) flag = False for item in sup: summa += item a = (summa + min(m * counter, k)) / counter total.append(a) for item in sup: k -= 1 if k >= 0: if counter > 1: ...
ASSIGN VAR 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 NUMBER EXPR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER FOR VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR FUNC_CALL VAR BIN_OP VAR VAR VAR VAR EXPR FUNC_CA...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) arr = list(map(int, input().split())) arr.sort() me = arr[n - 1] ind = 0 sarr = [(0) for i in range(n + 1)] for i in range(n - 1, -1, -1): sarr[i] = sarr[i + 1] + arr[i] ans = (sarr[0] + min(m, n * k)) / n for i in range(min(m, n - 1)): temp = sarr[i + 1] + min(m - 1 - i, (n ...
ASSIGN VAR 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 BIN_OP VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER VAR FUNC_CALL VAR BIN_OP VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR VAR...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, lim, total = map(int, input().split()) a = sorted(map(int, input().split())) psums = [0, a[0]] for i in range(1, n): psums.append(psums[i] + a[i]) def rangeSum(left, right): return psums[right + 1] - psums[left] ret = 0 for nDel in range(min(total + 1, n)): rem = n - nDel power = (min(rem * lim, ...
ASSIGN VAR 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 LIST NUMBER VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR VAR VAR FUNC_DEF RETURN BIN_OP VAR BIN_OP VAR NUMBER VAR VAR ASSIGN VAR NUMBER FOR VAR FUNC...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
import sys input = sys.stdin.readline for _ in range(1): n, k, m = map(int, input().split()) l = list(map(int, input().split())) l.sort() som = sum(l) rem = m // k rem_dash = m % k ans = (som + min(n * k, rem * k + rem_dash)) / n cnt = n for i in range(min(n - 1, m)): m -= 1...
IMPORT ASSIGN VAR VAR FOR VAR FUNC_CALL VAR NUMBER ASSIGN VAR 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 BIN_OP VAR VAR ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR FUNC_CALL VA...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
if True: n, k, m = tuple(map(int, input().split())) a = list(map(int, input().split())) else: n, k, m = 1000, 2, 40 a = list(range(n)) a.sort(reverse=True) middle_power = sum(a) num = n for i in range(n - 1, 0, -1): if (middle_power - a[i] + min(m - 1, k * (num - 1))) / (num - 1) > ( middle_...
IF NUMBER ASSIGN VAR 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 VAR VAR NUMBER NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FOR VAR FUNC_CA...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = list(map(int, input().split())) add = list(0 for _ in range(n)) a.sort() sm = int(sum(_ for _ in a)) res = 0 for i in range(min(m, n - 1)): res = max(res, (sm + min((n - i) * k, m - i)) / (n - i)) if i < m: res = max(res, (sm - a[i]) / (n - (i + 1))) sm -= a[i...
ASSIGN VAR 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 NUMBER VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP VAR...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
from itertools import accumulate n, k, m = [int(x) for x in input().split(" ")] a = sorted([int(x) for x in input().split(" ")]) a_sum = sum(a) pref_a = [0] + list(accumulate(a)) def score(rem): total = len(a) - rem return (a_sum - pref_a[rem] + min(total * k, m - rem)) / total print(max(map(score, range(m...
ASSIGN VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST NUMBER FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_DEF ASSIGN VAR BIN_OP FUNC_CALL VAR VAR VAR RETURN BIN_OP BIN_OP BIN_OP VA...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = list(map(int, input().split())) a.sort() total = sum(a) best = (total + min(n * k, m)) / n for i in range(n - 1): m -= 1 if m < 0: break rem = n - i - 1 total -= a[i] val = (total + min(rem * k, m)) / rem best = max(best, val) print(best)
ASSIGN VAR 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 BIN_OP BIN_OP VAR FUNC_CALL VAR BIN_OP VAR VAR VAR VAR FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER VAR NUMBER IF VAR NUMBER ASSIGN VAR BI...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = list(map(int, input().split())) a.sort() s = sum(a) l = n m2 = m maxi = round((s + min(k * l, m2)) / l, 9) if n - 1 >= m: n = m + 1 for i in range(n - 1): s -= a[i] l -= 1 m2 -= 1 maxi = round(max(maxi, (s + min(k * l, m2)) / l), 9) print(maxi)
ASSIGN VAR 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 ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP VAR FUNC_CALL VAR BIN_OP VAR VAR VAR VAR NUMBER IF BIN_OP VAR NUMBER VAR AS...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
import sys n, k, m = [int(tmp) for tmp in sys.stdin.readline().split()] a = [int(tmp) for tmp in sys.stdin.readline().split()] a.sort(reverse=True) sa = sum(a) sar = sa ld = n - min([n, m + 1]) rd = n while rd - ld != 1: td = (ld + 1 + rd) // 2 avsidthau = (sar - sum(a[td:rd]) + min([m - (n - td), td * k])) / ...
IMPORT ASSIGN VAR 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 VAR ASSIGN VAR VAR ASSIGN VAR BIN_OP VAR FUNC_CALL VAR LIST VAR BIN_OP VAR NUMBER ASSIGN VAR VAR WHILE BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) a = sorted([int(x) for x in input().split()]) prefix_sum = [sum(a)] for i in range(n): prefix_sum.append(prefix_sum[-1] - a[i]) ans = (sum(a) + min(m, n * k)) / n for i in range(1, min(m, n - 1) + 1): a = (prefix_sum[i] + min(m - i, k * (n - i))) / (n - i) ans = max(ans, ...
ASSIGN VAR 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 LIST FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR NUMBER VAR VAR ASSIGN VAR BIN_OP BIN_OP FUNC_CALL VAR VAR FUNC_CALL VAR VAR BIN_OP VAR VAR VAR FOR...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, m, k = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse=True) s = [] + a if m * n < k: s = a[: max(1, n - k + m * n)] s1 = (sum(s) + min(m * len(s), k)) / len(s) if k >= n - 1: ind = n - 1 - a[::-1].index(max(a)) l = a[: max(n - k, ind + 1)] sd = min(m * len(l), k - (n - l...
ASSIGN VAR 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 BIN_OP LIST VAR IF BIN_OP VAR VAR VAR ASSIGN VAR VAR FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP BIN_OP FUNC_CALL VAR VAR F...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) array = list(map(int, input().split())) array.sort() array = [0] + array sr = sum(array) / n sr_max = sr sr_max += min(m / n, k) l = n for i in range(1, min(n, m + 1)): sr = (sr * l - array[i]) / (l - 1) sr_max = max(sr + min((m - i) / (l - 1), k), sr_max) l -= 1 print(sr...
ASSIGN VAR 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 LIST NUMBER VAR ASSIGN VAR BIN_OP FUNC_CALL VAR VAR VAR ASSIGN VAR VAR VAR FUNC_CALL VAR BIN_OP VAR VAR VAR ASSIGN VAR VAR FOR VAR FUNC_CALL VAR NUMBER FUN...
Every superhero has been given a power value by the Felicity Committee. The avengers crew wants to maximize the average power of the superheroes in their team by performing certain operations. Initially, there are $n$ superheroes in avengers team having powers $a_1, a_2, \ldots, a_n$, respectively. In one operation, t...
n, k, m = map(int, input().split()) d = min(n * k, m) q = list(map(int, input().split()))[:n] a = [0] a = a + q a.sort() ans = 0 x = sum(a) for i in range(min(m, n - 1) + 1): x -= a[i] v = x + min(m - i, k * (n - i)) ans = max(ans, v / (n - i)) print(ans)
ASSIGN VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR BIN_OP VAR VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR ASSIGN VAR LIST NUMBER ASSIGN VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR BIN_OP ...
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
def answer(n): if n == 1: return -1 else: return [n, n + 1, n * (n + 1)] n = int(input()) x = answer(n) if x == -1: print(x) else: print(*x)
FUNC_DEF IF VAR NUMBER RETURN NUMBER RETURN LIST VAR BIN_OP VAR NUMBER BIN_OP VAR BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR IF VAR NUMBER EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
from sys import stdin, stdout n = int(stdin.readline()) ans = [] if n != 1: for x in range(n, n + 1000): if ans: break for y in range(x + 1, x + 1000): z = x * y * n // (x * y * 2 - n * (x + y)) if not x * y * n % (x * y * 2 - n * (x + y)) and z != x and z != y: ...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST IF VAR NUMBER FOR VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER IF VAR FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR BIN_OP BIN_OP BIN_OP VAR VAR NUMBER BIN_OP VAR BIN_OP VAR VAR IF BIN_OP BIN_OP BIN_OP VAR VAR VAR ...
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
n = int(input()) if n == 1: print(-1) else: x = n y = n + 1 z = x * y if z > int(1000000000.0): print(-1) else: print(f"{x} {y} {z}")
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR VAR IF VAR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR VAR STRING VAR STRING VAR
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
n = int(input()) a = n b = n + 1 c = n * (n + 1) if 2 * a * b * c == n * (a * b + a * c + b * c) and a != b and b != c and a != c: print(n, n + 1, n * (n + 1)) else: print(-1)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR BIN_OP VAR NUMBER IF BIN_OP BIN_OP BIN_OP NUMBER VAR VAR VAR BIN_OP VAR BIN_OP BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR BIN_OP VAR VAR VAR VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR VAR BIN_OP VAR NUMBER BIN_OP VAR BIN_OP V...
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
n = int(input()) d = 1000000000.0 x = n y = n + 1 z = n * (n + 1) if x > d or y > d or z > d or n == 1: print("-1") else: print(x, y, z)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR BIN_OP VAR NUMBER IF VAR VAR VAR VAR VAR VAR VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR VAR VAR VAR
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
n = int(input()) if n == 1: print(-1) elif n == 2: print(2, 3, 6) else: for i in range(1, n + 1): if n % i == 0: print(n, n + 1, n * n + n) exit()
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER IF BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR VAR BIN_OP VAR NUMBER BIN_OP BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
n = int(input()) if n * (n + 1) == n or n * (n + 1) == n + 1: print("-1") else: print(n, n + 1, n * (n + 1))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF BIN_OP VAR BIN_OP VAR NUMBER VAR BIN_OP VAR BIN_OP VAR NUMBER BIN_OP VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR VAR BIN_OP VAR NUMBER BIN_OP VAR BIN_OP VAR NUMBER
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
primes = [True] * 10001 primes[0] = primes[1] = False for i in range(2, int(10000**0.5) + 1): if primes[i]: for x in range(i * 2, 10001, i): primes[x] = False def facto(n): i = 1 arr = [0] * (n + 1) while i <= int(n**0.5): i += 1 if n % i == 0: while n %...
ASSIGN VAR BIN_OP LIST NUMBER NUMBER ASSIGN VAR NUMBER VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP FUNC_CALL VAR BIN_OP NUMBER NUMBER NUMBER IF VAR VAR FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER VAR ASSIGN VAR VAR NUMBER FUNC_DEF ASSIGN VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER WHILE VAR ...
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
n = int(input()) if n == 1: print(-1) exit() x = n y = n + 1 z = n * (n + 1) print(x, y, z)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR ASSIGN VAR VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR VAR VAR VAR
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
n = int(input()) if n == 1 or n * (n + 1) > 10**9: print(-1) else: print(n, n + 1, n * (n + 1), sep=" ")
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER BIN_OP VAR BIN_OP VAR NUMBER BIN_OP NUMBER NUMBER EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR VAR BIN_OP VAR NUMBER BIN_OP VAR BIN_OP VAR NUMBER STRING
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
n = int(input()) if n == 1: print("-1") exit() else: b = n + 1 c = b * n if max(n, b, c) >= 10**9: print("-1") else: print(n, b, c)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR VAR IF FUNC_CALL VAR VAR VAR VAR BIN_OP NUMBER NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR VAR VAR VAR
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
def solve(): n = int(input()) fixed = n current = n + 1 product = n * current if n == 1: print(-1) return while True: while product // n != product // current + 1: current += 1 product = n * current if product < 10**9 and current < 10**9 an...
FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR VAR IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER RETURN WHILE NUMBER WHILE BIN_OP VAR VAR BIN_OP BIN_OP VAR VAR NUMBER VAR NUMBER ASSIGN VAR BIN_OP VAR VAR IF VAR BIN_OP NUMBER NUMBER VAR BIN_OP NUMBER NUMBER VA...
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
x = int(input()) s = set() s.add(x) s.add(x + 1) s.add(x * (x + 1)) if len(s) != 3: print(-1) else: print(*list(s))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR BIN_OP VAR NUMBER IF FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR VAR
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
def ratios(n): if n * (n + 1) <= 1000000000 and n != 1: return n, n + 1, n * (n + 1) return [-1] print(*ratios(int(input())))
FUNC_DEF IF BIN_OP VAR BIN_OP VAR NUMBER NUMBER VAR NUMBER RETURN VAR BIN_OP VAR NUMBER BIN_OP VAR BIN_OP VAR NUMBER RETURN LIST NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
def solveQ1(n, a, b, s): if s[a - 1] == s[b - 1]: return 0 c = s[b - 1] n = len(s) min_dist = n for i in range(n): if s[i] == c: min_dist = min(abs(a - 1 - i), min_dist) return min_dist def solveQ2(n, k): if n == 1: return 1 if k == pow(2, n - 1): ...
FUNC_DEF IF VAR BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER RETURN NUMBER ASSIGN VAR VAR BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER VAR VAR RETURN VAR FUNC_DEF IF VAR NUMBER RETURN NUMBER IF VAR FUNC_...
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
n = int(input()) x = n y = n + 1 z = n * (n + 1) if n < 2 or z > 10**9: print(-1) else: print(x, y, z)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR BIN_OP VAR NUMBER IF VAR NUMBER VAR BIN_OP NUMBER NUMBER EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR VAR VAR VAR
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
def yolo(n): denom = 0 k = 0 if n % 2 == 1: k = (n + 1) / 2 denom = n * k if denom > 0: a, b, c = [int(x) for x in [k, denom + 1, denom * (denom + 1)]] if ( a == k and b == denom + 1 and c == denom * (denom + 1) and (a < 10*...
FUNC_DEF ASSIGN VAR NUMBER ASSIGN VAR NUMBER IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP VAR VAR IF VAR NUMBER ASSIGN VAR VAR VAR FUNC_CALL VAR VAR VAR LIST VAR BIN_OP VAR NUMBER BIN_OP VAR BIN_OP VAR NUMBER IF VAR VAR VAR BIN_OP VAR NUMBER VAR BIN_OP VAR BIN_OP VAR NUMBER V...
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
n = int(input()) if n == 1: print(-1) else: s = str(n) + " " + str(n + 1) + " " + str(n * (n + 1)) print(s)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP FUNC_CALL VAR VAR STRING FUNC_CALL VAR BIN_OP VAR NUMBER STRING FUNC_CALL VAR BIN_OP VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR VAR
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
n = int(input()) a = 2 * (n + 1) - 1 b = n * (n + 1) c = a // 2 d = (a + 1) // 2 inf = 1000000000.0 if b % c == 0 and b % d == 0: c = b // c d = b // d if b <= inf and c <= inf and d <= inf and b != c and d != c: print(b, c, d) else: print(-1) else: print(-1)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP NUMBER BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER NUMBER ASSIGN VAR NUMBER IF BIN_OP VAR VAR NUMBER BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP VAR...
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
n = int(input()) if n * (n + 1) <= 10**9: if n == 1: print(-1) else: print(n, n + 1, n * (n + 1)) else: print(-1)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF BIN_OP VAR BIN_OP VAR NUMBER BIN_OP NUMBER NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR VAR BIN_OP VAR NUMBER BIN_OP VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR NUMBER
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
n = int(input()) if n * (n + 1) > 2000000000 or n == 0 or n == 1: print(-1) else: print(n, end=" ") print(n + 1, end=" ") print(n * (n + 1), end=" ")
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF BIN_OP VAR BIN_OP VAR NUMBER NUMBER VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR VAR STRING EXPR FUNC_CALL VAR BIN_OP VAR NUMBER STRING EXPR FUNC_CALL VAR BIN_OP VAR BIN_OP VAR NUMBER STRING
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
n = int(input()) a, b, c = n, n + 1, n * (n + 1) if a > int(1000000000.0) or b > int(1000000000.0) or c > int(1000000000.0): print(-1) elif a == b or b == c or a == c: print(-1) else: print(a, b, c)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR VAR VAR BIN_OP VAR NUMBER BIN_OP VAR BIN_OP VAR NUMBER IF VAR FUNC_CALL VAR NUMBER VAR FUNC_CALL VAR NUMBER VAR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR NUMBER IF VAR VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR VAR VAR VAR
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
a = int(input()) b = 1 if a == 3: b = 0 print("2 7 42") if a == 1: print("-1") b = 0 if b == 1: print(a, a + 1, a * (a + 1))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER IF VAR NUMBER ASSIGN VAR NUMBER EXPR FUNC_CALL VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR STRING ASSIGN VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR VAR BIN_OP VAR NUMBER BIN_OP VAR BIN_OP VAR NUMBER
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
from sys import argv, exit def get_str(): return input() def get_int(): return int(input()) def get_ints(): return [int(i) for i in input().split(" ")] def prnt(*args): if "-v" in argv: print(*args) n = get_int() if n == 1: print("-1") exit(0) print("{} {} {}".format(n, n + 1, ...
FUNC_DEF RETURN FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING FUNC_DEF IF STRING VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL STRING VAR ...
Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction <image> as a sum of three distinct positive fractions in form <image>. Help Vladik with that, i.e for a given n find three distinct positive integers x, y and z such that <image...
n = int(input()) a, b, c = n, n + 1, n * (n + 1) if a == b or b == c or c == a: print(-1) else: print(a, b, c)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR VAR VAR BIN_OP VAR NUMBER BIN_OP VAR BIN_OP VAR NUMBER IF VAR VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR VAR VAR VAR
The year of 2012 is coming... According to an ancient choradrican legend in this very year, in 2012, Diablo and his brothers Mephisto and Baal will escape from hell, and innumerable hordes of demons will enslave the human world. But seven brave heroes have already gathered on the top of a mountain Arreat to protect us...
import itertools def sets(heros, min_elem, max_elem): ans = [] if max_elem > len(heros): max_elem = len(heros) if min_elem > len(heros): return [] for i in range(min_elem, max_elem + 1): s = itertools.combinations(heros, i) for ss in s: ans.append(ss) re...
IMPORT FUNC_DEF ASSIGN VAR LIST IF VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR IF VAR FUNC_CALL VAR VAR RETURN LIST FOR VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR FOR VAR VAR EXPR FUNC_CALL VAR VAR RETURN VAR FUNC_DEF ASSIGN VAR BIN_OP VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR FUN...