description stringlengths 171 4k | code stringlengths 94 3.98k | normalized_code stringlengths 57 4.99k |
|---|---|---|
Vasya has got a robot which is situated on an infinite Cartesian plane, initially in the cell $(0, 0)$. Robot can perform the following four kinds of operations: U β move from $(x, y)$ to $(x, y + 1)$; D β move from $(x, y)$ to $(x, y - 1)$; L β move from $(x, y)$ to $(x - 1, y)$; R β move from $(x, y)$ to $(x + 1... | n = int(input())
s = input()
x, y = [int(x) for x in input().split()]
if abs(x) + abs(y) > n or (n - abs(x) - abs(y)) % 2 != 0:
print(-1)
exit()
left = [(0, 0)]
for i in range(n):
last_x, last_y = left[-1]
if s[i] == "U":
left.append((last_x, last_y + 1))
elif s[i] == "R":
left.appen... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR IF BIN_OP FUNC_CALL VAR VAR FUNC_CALL VAR VAR VAR BIN_OP BIN_OP BIN_OP VAR FUNC_CALL VAR VAR FUNC_CALL VAR VAR NUMBER NUMBER EXPR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR ASSIGN VAR LIST NUMBER NU... |
Vasya has got a robot which is situated on an infinite Cartesian plane, initially in the cell $(0, 0)$. Robot can perform the following four kinds of operations: U β move from $(x, y)$ to $(x, y + 1)$; D β move from $(x, y)$ to $(x, y - 1)$; L β move from $(x, y)$ to $(x - 1, y)$; R β move from $(x, y)$ to $(x + 1... | import itertools
import sys
def solve(L, n, px, py, x, y):
for i in range(n):
j = i + L
if j > n:
break
dx = px[i] + px[-1] - px[j] - x
dy = py[i] + py[-1] - py[j] - y
if abs(dx) + abs(dy) <= L:
return True
return False
def main(args):
n = ... | IMPORT IMPORT FUNC_DEF FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR VAR IF VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR NUMBER VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR NUMBER VAR VAR VAR IF BIN_OP FUNC_CALL VAR VAR FUNC_CALL VAR VAR VAR RETURN NUMBER RETURN NUMBER FUNC_DEF ASSIGN VAR FUNC_CALL ... |
Vasya has got a robot which is situated on an infinite Cartesian plane, initially in the cell $(0, 0)$. Robot can perform the following four kinds of operations: U β move from $(x, y)$ to $(x, y + 1)$; D β move from $(x, y)$ to $(x, y - 1)$; L β move from $(x, y)$ to $(x - 1, y)$; R β move from $(x, y)$ to $(x + 1... | import sys
fin = sys.stdin.readline
n = int(fin())
commands = list(fin())[:-1]
x, y = [int(elem) for elem in fin().split(" ")]
move_map = {"L": (-1, 0), "R": (1, 0), "U": (0, 1), "D": (0, -1)}
if (x + y) % 2 != n % 2:
print(-1)
exit(0)
cuml_coord = [None] * n
cuml_x, cuml_y = 0, 0
for i, command in enumerate(c... | IMPORT ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR DICT STRING STRING STRING STRING NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER IF BIN_OP BIN_OP VAR VAR NUMBER BIN_OP VAR NU... |
Vasya has got a robot which is situated on an infinite Cartesian plane, initially in the cell $(0, 0)$. Robot can perform the following four kinds of operations: U β move from $(x, y)$ to $(x, y + 1)$; D β move from $(x, y)$ to $(x, y - 1)$; L β move from $(x, y)$ to $(x - 1, y)$; R β move from $(x, y)$ to $(x + 1... | d = {"U": (0, 1), "D": (0, -1), "L": (-1, 0), "R": (1, 0)}
def compute_delta(s, head_idx, tail_idx):
x = y = 0
for i in range(head_idx, tail_idx):
x, y = x + d[s[i]][0], y + d[s[i]][1]
return x, y
def compute_rest(s, n, head_idx, tail_idx):
x = y = 0
for i in range(0, head_idx):
... | ASSIGN VAR DICT STRING STRING STRING STRING NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER FUNC_DEF ASSIGN VAR VAR NUMBER FOR VAR FUNC_CALL VAR VAR VAR ASSIGN VAR VAR BIN_OP VAR VAR VAR VAR NUMBER BIN_OP VAR VAR VAR VAR NUMBER RETURN VAR VAR FUNC_DEF ASSIGN VAR VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR ASSIG... |
There is unrest in the Galactic Senate. Several thousand solar systems have declared their intentions to leave the Republic. Master Heidi needs to select the Jedi Knights who will go on peacekeeping missions throughout the galaxy. It is well-known that the success of any peacekeeping mission depends on the colors of th... | INF = 1 << 60
n, m = map(int, input().split())
a = list(map(int, input().split()))
Constraint = [0] + list(map(int, input().split()))
pos = 0
satisfied_color = 0
for i in range(1, m + 1):
if Constraint[i] == 0:
satisfied_color += 1
GETCOLOR = [0] * (n + 1)
ans = INF
waste = 0
for i in range(n):
while sa... | ASSIGN VAR BIN_OP NUMBER NUMBER 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 LIST NUMBER FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NU... |
There is unrest in the Galactic Senate. Several thousand solar systems have declared their intentions to leave the Republic. Master Heidi needs to select the Jedi Knights who will go on peacekeeping missions throughout the galaxy. It is well-known that the success of any peacekeeping mission depends on the colors of th... | n, m = map(int, input().split())
c = list(map(int, input().split()))
k = list(map(int, input().split()))
p = [0] * m
c = [(i - 1) for i in c]
s = sum(k)
cnt = k.count(0)
l = 0
r = 0
while r < n and cnt < m:
p[c[r]] += 1
if p[c[r]] == k[c[r]]:
cnt += 1
r += 1
if cnt != m:
print(-1)
return
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 ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR NUMB... |
There is unrest in the Galactic Senate. Several thousand solar systems have declared their intentions to leave the Republic. Master Heidi needs to select the Jedi Knights who will go on peacekeeping missions throughout the galaxy. It is well-known that the success of any peacekeeping mission depends on the colors of th... | n, m = list(map(int, input().split()))
arr = list(map(int, input().split()))
marr = list(map(int, input().split()))
f = [0] * (m + 1)
cnt, i = 0, 0
valid = sum(marr)
while i < n:
f[arr[i]] += 1
if f[arr[i]] <= marr[arr[i] - 1]:
cnt += 1
if cnt == valid:
break
i += 1
if i == n:
print(... | ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER ASSIGN VAR VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR VAR WHILE VAR... |
This is the hard version of this problem. The only difference between the easy and hard versions is the constraints on $k$ and $m$. In this version of the problem, you need to output the answer by modulo $10^9+7$.
You are given a sequence $a$ of length $n$ consisting of integers from $1$ to $n$. The sequence may conta... | t = int(input())
for tc in range(t):
l = input().split()
n = int(l[0])
m = int(l[1])
k = int(l[2])
v = input().split()
for i in range(n):
v[i] = int(v[i])
v.sort()
if n < m:
print(0)
else:
comb = []
for i in range(n):
comb.append(1)
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR 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 FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL... |
This is the hard version of this problem. The only difference between the easy and hard versions is the constraints on $k$ and $m$. In this version of the problem, you need to output the answer by modulo $10^9+7$.
You are given a sequence $a$ of length $n$ consisting of integers from $1$ to $n$. The sequence may conta... | def modulo(n, prime, dp1):
dp1[0] = dp1[1] = 1
for j in range(2, n + 1):
dp1[j] = dp1[j - 1] * j % prime
t = int(input())
for i in range(t):
n, m, p = map(int, input().split())
mod1 = int(1000000000.0 + 7)
a = list(map(int, input().split()))
a.sort()
val = 0
j = 0
k = 0
... | FUNC_DEF ASSIGN VAR NUMBER VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR BIN_OP NUMBER NUMB... |
This is the hard version of this problem. The only difference between the easy and hard versions is the constraints on $k$ and $m$. In this version of the problem, you need to output the answer by modulo $10^9+7$.
You are given a sequence $a$ of length $n$ consisting of integers from $1$ to $n$. The sequence may conta... | import sys
input = sys.stdin.readline
mod_ = 10**9 + 7
factos = [1]
inv_factos = []
for elem in range(1, 2 * 10**5 + 1):
factos.append(factos[-1] * elem % mod_)
for val in factos:
inv_factos.append(pow(val, mod_ - 2, mod_))
def solution(n, m, k, arr):
left = 0
right = 0
sol = 0
arr.sort()
... | IMPORT ASSIGN VAR VAR ASSIGN VAR BIN_OP BIN_OP NUMBER NUMBER NUMBER ASSIGN VAR LIST NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER BIN_OP BIN_OP NUMBER BIN_OP NUMBER NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER VAR VAR FOR VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER VAR FUNC_DEF ASS... |
This is the hard version of this problem. The only difference between the easy and hard versions is the constraints on $k$ and $m$. In this version of the problem, you need to output the answer by modulo $10^9+7$.
You are given a sequence $a$ of length $n$ consisting of integers from $1$ to $n$. The sequence may conta... | R = lambda: map(int, input().split())
mod = 10**9 + 7
fac = [1] * (2 * 10**5 + 7)
for i in range(2, len(fac)):
fac[i] = fac[i - 1] * i % mod
def cnk(nn, kk):
return fac[nn] * pow(fac[nn - kk], mod - 2, mod) * pow(fac[kk], mod - 2, mod) % mod
for _ in range(int(input())):
n, m, k = R()
arr = sorted(R... | ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP NUMBER NUMBER NUMBER ASSIGN VAR BIN_OP LIST NUMBER BIN_OP BIN_OP NUMBER BIN_OP NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR VAR FUNC_DEF RETURN BIN_OP BIN_OP BIN_OP... |
This is the hard version of this problem. The only difference between the easy and hard versions is the constraints on $k$ and $m$. In this version of the problem, you need to output the answer by modulo $10^9+7$.
You are given a sequence $a$ of length $n$ consisting of integers from $1$ to $n$. The sequence may conta... | MOD = 10**9 + 7
M = 3 * 10**5
fac = [1] * M
for i in range(1, M):
fac[i] = fac[i - 1] * i % MOD
def nCk(n, k):
if n < k:
return 0
return fac[n] * pow(fac[n - k], MOD - 2, MOD) * pow(fac[k], MOD - 2, MOD) % MOD
t = int(input())
while t:
t -= 1
n, m, k = map(int, input().split())
a = l... | ASSIGN VAR BIN_OP BIN_OP NUMBER NUMBER NUMBER ASSIGN VAR BIN_OP NUMBER BIN_OP NUMBER NUMBER ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR VAR FUNC_DEF IF VAR VAR RETURN NUMBER RETURN BIN_OP BIN_OP BIN_OP VAR VAR FUNC_CALL VAR VAR BIN_OP VAR VAR... |
This is the hard version of this problem. The only difference between the easy and hard versions is the constraints on $k$ and $m$. In this version of the problem, you need to output the answer by modulo $10^9+7$.
You are given a sequence $a$ of length $n$ consisting of integers from $1$ to $n$. The sequence may conta... | mod = 1000000007
fact = [1]
def inv(a):
return pow(a, mod - 2, mod)
def C(n, k):
if k > n:
return 0
return fact[n] * inv(fact[k] * fact[n - k] % mod) % mod
def fac(n, p):
for i in range(p, n + 1):
fact.append(fact[i - 1] * i % mod)
p = p + 1
return p
def initialize(n,... | ASSIGN VAR NUMBER ASSIGN VAR LIST NUMBER FUNC_DEF RETURN FUNC_CALL VAR VAR BIN_OP VAR NUMBER VAR FUNC_DEF IF VAR VAR RETURN NUMBER RETURN BIN_OP BIN_OP VAR VAR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR VAR BIN_OP VAR VAR VAR VAR FUNC_DEF FOR VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR BIN_OP ... |
This is the hard version of this problem. The only difference between the easy and hard versions is the constraints on $k$ and $m$. In this version of the problem, you need to output the answer by modulo $10^9+7$.
You are given a sequence $a$ of length $n$ consisting of integers from $1$ to $n$. The sequence may conta... | delta = 10**9 + 7
factorial = [1] * 200001
inverse = [1] * 200001
for i in range(1, 200001):
factorial[i] = factorial[i - 1] * i % delta
inverse[i] = pow(factorial[i], delta - 2, delta)
t = int(input())
flag = True
for _ in range(t):
n, m, k = tuple(map(int, input().split()))
if n < m:
input()
... | ASSIGN VAR BIN_OP BIN_OP NUMBER NUMBER NUMBER ASSIGN VAR BIN_OP LIST NUMBER NUMBER ASSIGN VAR BIN_OP LIST NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR BIN_OP VAR NUMBER VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN ... |
This is the hard version of this problem. The only difference between the easy and hard versions is the constraints on $k$ and $m$. In this version of the problem, you need to output the answer by modulo $10^9+7$.
You are given a sequence $a$ of length $n$ consisting of integers from $1$ to $n$. The sequence may conta... | import sys
input = sys.stdin.readline
mod = MOD = 10**9 + 7
M = 3 * 10**5
fac = [1] * M
for i in range(1, M):
fac[i] = fac[i - 1] * i % MOD
def printNcR(n, r):
if n < r:
return 0
a = fac[n]
b = fac[n - r] * fac[r] % MOD
b = pow(b, MOD - 2, MOD)
return a * b % MOD
for _ in range(int(... | IMPORT ASSIGN VAR VAR ASSIGN VAR VAR BIN_OP BIN_OP NUMBER NUMBER NUMBER ASSIGN VAR BIN_OP NUMBER BIN_OP NUMBER NUMBER ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR VAR FUNC_DEF IF VAR VAR RETURN NUMBER ASSIGN VAR VAR VAR ASSIGN VAR BIN_OP BIN_O... |
This is the hard version of this problem. The only difference between the easy and hard versions is the constraints on $k$ and $m$. In this version of the problem, you need to output the answer by modulo $10^9+7$.
You are given a sequence $a$ of length $n$ consisting of integers from $1$ to $n$. The sequence may conta... | import sys
M = 10**9 + 7
a = [1]
for i in range(1, 8**6):
a += (a[-1] * i % M,)
R = lambda: map(int, sys.stdin.readline().split())
f = lambda x: x >= m and a[x] * pow(a[x - m], M - 2, M)
(t,) = R()
for _ in [0] * t:
n, m, k = R()
c = [0] * n
for x in R():
c[x - 1] += 1
for i in range(n - 1)... | IMPORT ASSIGN VAR BIN_OP BIN_OP NUMBER NUMBER NUMBER ASSIGN VAR LIST NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP NUMBER NUMBER VAR BIN_OP BIN_OP VAR NUMBER VAR VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR VAR BIN_OP VAR VAR FUNC_CALL VAR VAR BIN_OP VAR VAR BIN_OP VAR NUMBER VAR ASSIGN VAR FUNC... |
This is the hard version of this problem. The only difference between the easy and hard versions is the constraints on $k$ and $m$. In this version of the problem, you need to output the answer by modulo $10^9+7$.
You are given a sequence $a$ of length $n$ consisting of integers from $1$ to $n$. The sequence may conta... | t = int(input())
MOD = 10**9 + 7
lazyfac = [1, 1]
inversfac = [1, 1]
def upfac(lazyfac, inversefac, n):
while len(lazyfac) < n + 1:
lazyfac.append(lazyfac[-1] * len(lazyfac) % MOD)
inversfac.append(pow(lazyfac[-1], -1, MOD))
def choose(n, m):
return lazyfac[n] * inversfac[n - m] * inversfac[... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP NUMBER NUMBER NUMBER ASSIGN VAR LIST NUMBER NUMBER ASSIGN VAR LIST NUMBER NUMBER FUNC_DEF WHILE FUNC_CALL VAR VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER NUMBER VAR FUN... |
This is the hard version of this problem. The only difference between the easy and hard versions is the constraints on $k$ and $m$. In this version of the problem, you need to output the answer by modulo $10^9+7$.
You are given a sequence $a$ of length $n$ consisting of integers from $1$ to $n$. The sequence may conta... | def modInverse(a, m):
assert m > 0, "Error"
x, y = 1, 0
if m == 1:
return 0
while a > 1:
q = a // m
x, y = y, x - q * y
a, m = m, a % m
return x
def C(n, r, fact, inv, mod):
if r > n or r < 0:
return 0
res = fact[n] * inv[r] % mod
res = res * inv... | FUNC_DEF VAR NUMBER STRING ASSIGN VAR VAR NUMBER NUMBER IF VAR NUMBER RETURN NUMBER WHILE VAR NUMBER ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR VAR VAR BIN_OP VAR BIN_OP VAR VAR ASSIGN VAR VAR VAR BIN_OP VAR VAR RETURN VAR FUNC_DEF IF VAR VAR VAR NUMBER RETURN NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR VAR VAR ASSIGN VAR BI... |
This is the hard version of this problem. The only difference between the easy and hard versions is the constraints on $k$ and $m$. In this version of the problem, you need to output the answer by modulo $10^9+7$.
You are given a sequence $a$ of length $n$ consisting of integers from $1$ to $n$. The sequence may conta... | mod = pow(10, 9) + 7
fact = [1]
for i in range(1, 200001):
fact.append(fact[i - 1] * i % mod)
def modinv(a, m):
return pow(a, m - 2, m)
def c(n, r):
return fact[n] * modinv(fact[n - r] * fact[r] % mod, mod) % mod
def find(a, low, k, m):
ele = a[low]
j = low
high = len(a) - 1
pl, ph = l... | ASSIGN VAR BIN_OP FUNC_CALL VAR NUMBER NUMBER NUMBER ASSIGN VAR LIST NUMBER FOR VAR FUNC_CALL VAR NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR VAR FUNC_DEF RETURN FUNC_CALL VAR VAR BIN_OP VAR NUMBER VAR FUNC_DEF RETURN BIN_OP BIN_OP VAR VAR FUNC_CALL VAR BIN_OP BIN_OP VAR BIN_OP VAR VAR VAR ... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for case in range(int(input())):
n, k = [int(x) for x in input().split()]
series = [int(x) for x in input().split()]
new_series = []
for i in range(n):
if series[i] % k == 0:
series[i] = 0
else:
series[i] = k - series[i] % k
new_series.append(series[i]... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR 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 LIST FOR VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR BIN_OP VAR BIN_OP VAR VAR VAR EXPR FUNC_CALL... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for _ in range(int(input())):
a, b = map(int, input().split())
z = list(map(int, input().split()))
d, ans, w = {}, 0, 0
for i in z:
q = i % b
if q != 0:
if q in d:
d[q] += 1
else:
d[q] = 1
for i in d:
ans = max(ans, b - ... | FOR VAR FUNC_CALL 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 ASSIGN VAR VAR VAR DICT NUMBER NUMBER FOR VAR VAR ASSIGN VAR BIN_OP VAR VAR IF VAR NUMBER IF VAR VAR VAR VAR NUMBER ASSIGN VAR VAR NUMBER FOR VAR ... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | from sys import exit, stdin
input = stdin.readline
def i():
return input()
def ii():
return int(input())
def iis():
return map(int, input().split())
def liis():
return list(map(int, input().split()))
def print_array(a):
print(" ".join(map(str, a)))
t = ii()
for _ in range(t):
n, k =... | ASSIGN VAR VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF EXPR FUNC_CALL VAR FUNC_CALL STRING FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL VAR FOR VAR F... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for _ in range(int(input())):
n, k = [int(x) for x in input().split()]
a = [(k - int(x) % k) for x in input().split()]
checker = dict()
for i in a:
if i == k:
continue
if i not in checker:
checker[i] = 0
checker[i] += 1
bestVal = 0
bestAdd = 0
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR BIN_OP FUNC_CALL VAR VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR VAR IF VAR VAR IF VAR VAR ASSIGN VAR VAR NUMBER VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBE... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for _ in range(int(input())):
n, k = map(int, input().split())
arr = list(map(int, input().split(" ")))
N = len(arr)
m = {}
ans = 0
for i in range(N):
if arr[i] % k:
m[k - arr[i] % k] = m.get(k - arr[i] % k, 0) + 1
flag = False
for s in m:
flag = True
... | FOR VAR FUNC_CALL 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 STRING ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR DICT ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | inp = lambda: map(int, input().split(" "))
(t,) = inp()
for _ in range(t):
n, k = inp()
arr = list(inp())
count = {}
max_val = 0
max_index = 0
for i in arr:
rem = (k - i % k) % k
if rem not in count:
count[rem] = 0
count[rem] += 1
if count[rem] > max_v... | ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR DICT ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP VAR VAR VAR IF VAR VAR ASSIGN VAR VAR NUM... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for _ in range(int(input())):
n, k = map(int, input().split())
l = list(map(int, input().split()))
d = {}
d[0] = 0
if k == 1:
print(0)
continue
for i in range(n):
temp = l[i] % k
if temp == 0:
d[0] += 1
elif k - temp in d:
d[k - tem... | FOR VAR FUNC_CALL 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 ASSIGN VAR DICT ASSIGN VAR NUMBER NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR VAR VAR IF VAR NU... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for _ in range(t):
n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n):
a[i] %= k
a[i] = k - a[i]
if a[i] == k:
a[i] = 0
a.sort()
x = a[0]
cnt = 0
ans = 0
for i in a:
if i == 0:
co... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR VAR VAR VAR ASSIGN VAR VAR BIN_OP VAR VAR VAR IF VAR VAR VAR ASSIGN VAR VAR NUMBER EXPR FUNC_CALL VAR ASS... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | def increment(umap, x):
try:
umap[x] += 1
except:
umap[x] = 1
def solve():
n, k = map(int, input().strip().split())
a = list(map(int, input().strip().split()))
umap = {}
maxVal = 0
maxBy = 0
for i in a:
rem = -i % k
increment(umap, rem)
if umap[r... | FUNC_DEF VAR VAR NUMBER ASSIGN VAR VAR NUMBER FUNC_DEF ASSIGN VAR 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 DICT ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR ASSIGN VAR BIN_OP VAR VAR EXPR FUNC_CALL VAR VAR VAR IF V... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for _ in range(int(input())):
n, k = map(int, input().split())
l = list(map(int, input().split()))
l1 = []
for i in range(n):
if l[i] % k != 0:
l1.append(k - l[i] % k)
if len(l1) == 0:
print(0)
else:
l1.sort()
t = 1
temp = 0
mv = l1[-1]... | FOR VAR FUNC_CALL 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 ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR BIN_OP VAR VAR VAR IF FUNC_CALL VAR VAR NUMBE... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
def function(s, k):
return (k - s % k) * (s % k != 0)
answer = []
for _ in range(t):
n, k = map(int, input().split(" "))
a = [function(x, k) for x in list(map(int, input().split(" ")))]
a.sort()
max_count = 0
remainder = 0
actual = 0
count_actual = 0
for i in ran... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN BIN_OP BIN_OP VAR BIN_OP VAR VAR BIN_OP VAR VAR NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING EXPR... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | a = int(input())
for i in range(0, a):
n, k = map(int, input().split())
arr = list(map(int, input().split()))
rem = []
for i in arr:
if not i % k == 0:
rem.append(k - i % k)
srem = set()
rem.sort()
d = dict()
for i in rem:
d[i] = 1
for i in rem:
if... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR VAR IF BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR BIN_OP VAR VAR ASSIGN VAR FUNC_CALL VAR E... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for _ in " " * int(input()):
a, b = map(int, input().split())
d = dict()
for i in map(int, input().split()):
if i % b:
d[b - i % b] = d.get(b - i % b, 0) + 1
if len(d) == 0:
print(0)
continue
s = 0
s1 = 0
for i in sorted(d, reverse=True):
if d[i] >... | FOR VAR BIN_OP STRING FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF BIN_OP VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR BIN_OP FUNC_CALL VAR BIN_OP VAR BIN_OP VAR VAR NUMBER NUMBER IF FUNC_CALL VAR VAR N... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for i in range(t):
n, k = input().split()
n = int(n)
k = int(k)
ls = list(map(int, input().split()))
mod_dict = {}
for item in ls:
mod = item % k
if mod in mod_dict:
mod_dict[item % k] += 1
else:
mod_dict[item % k] = 1
if 0 in ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR DICT FOR VAR VAR ASSIGN VAR BIN_OP VAR VAR IF VAR VAR VAR BIN_OP VAR VAR NUMBER ... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for casos in range(t):
n, k = [int(x) for x in input().split()]
a = [(k - int(i) % k) for i in input().split() if int(i) % k != 0]
a.sort()
n = len(a)
if n == 0:
print(0)
else:
cnt = 1
mxfreq = 1
mxval = a[0]
for i in range(1, len(a)):
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR BIN_OP FUNC_CALL VAR VAR VAR VAR FUNC_CALL FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR VAR NUMBER EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR IF VAR NUMBER EXPR FUNC_CALL VA... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for _ in range(t):
n, k = map(int, input().split())
A = list(map(int, input().split()))
if k == 1:
print(0)
continue
D = dict()
for i in range(n):
toAdd = (k - A[i] % k) % k
if toAdd > 0:
D[toAdd] = D.get(toAdd, 0) + 1
if len(D) == 0:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP VAR ... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | def one_case():
n, kk = map(int, input().split())
a = [int(x) for x in input().split()]
d = {}
for i in a:
m = i % kk
if m in d:
d[m] += 1
else:
d[m] = 1
mk, mv = 1, 0
for k, v in d.items():
if k == 0:
continue
if mv < v... | FUNC_DEF ASSIGN 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 DICT FOR VAR VAR ASSIGN VAR BIN_OP VAR VAR IF VAR VAR VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER NUMBER FOR VAR VAR FUNC_CALL VAR IF VAR NUMBER IF VAR VAR VAR VAR VAR VAR... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for _ in range(t):
n, k = map(int, input().split())
A = list(map(lambda x: k - int(x) % k if int(x) % k else 0, input().split()))
cnt = 0
d = {}
for a in A:
if a == 0:
cnt += 1
continue
if a not in d:
d[a] = 1
else:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR VAR BIN_OP VAR BIN_OP FUNC_CALL VAR VAR VAR NUMBER FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR DICT FOR VAR VAR IF VAR NUMBER... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | def array_converter(k, numbers):
numbers = [(number, k - number % k) for number in numbers if number % k]
if not len(numbers):
return 0
requirements = dict()
number_dict = dict()
for number, requirement in numbers:
requirements[requirement] = requirements.get(requirement, -1) + 1
... | FUNC_DEF ASSIGN VAR VAR BIN_OP VAR BIN_OP VAR VAR VAR VAR BIN_OP VAR VAR IF FUNC_CALL VAR VAR RETURN NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR VAR VAR ASSIGN VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER NUMBER ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR VAR VAR RETURN BIN_OP FUNC_CALL VAR FUNC_CALL VAR NUMBE... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for T in range(t):
n, k = [int(i) for i in input().split()]
array = [int(i) for i in input().split()]
array_modk = [((k - i) % k) for i in array]
sums = {i: (0) for i in array_modk}
for i in array_modk:
if i != 0:
sums[i] += 1
maxi = max(sums.values())
ca... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR 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 VAR VAR VAR VAR ASSIGN VAR VAR NUMBER VAR VAR FOR VAR VAR IF VAR NUMBER VAR VAR NUMBER ASSIGN VAR FUNC_CALL ... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | def mykey(x):
return x[0]
t = int(input())
for i in range(0, t):
nk = input().split()
n = int(nk[0])
k = int(nk[1])
L = list(map(int, input().split()))
M = list(map(lambda x: (k - x) % k, L))
if all(e == 0 for e in M):
print(0)
else:
M.sort()
dict = {}
d... | FUNC_DEF RETURN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR 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 VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR BIN_OP B... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for _ in range(int(input())):
n, k = list(map(int, input().split()))
arr = list(map(int, input().split()))
modulo = {}
for i in range(n):
m = (k - arr[i]) % k
if m in modulo:
modulo[m] += 1
else:
modulo[m] = 1
if 0 in modulo:
n -= modulo[0]
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL 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 FUNC_CALL VAR ASSIGN VAR DICT FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR VAR IF VAR VAR VAR VAR NUMBER ASSIGN VAR VAR NUMBER I... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | i = int(input())
def return_ind(elt, l, f):
for i, e in enumerate(l[:f]):
if e == elt:
return i
return -1
for j in range(i):
n, k = input().split()
n, k = int(n), int(k)
u = list(input().split())
a = [(int(u[i]) % k) for i in range(n)]
a.sort()
indices = [i for i ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF FOR VAR VAR FUNC_CALL VAR VAR VAR IF VAR VAR RETURN VAR RETURN NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP FUNC_CALL VAR VAR V... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for _ in range(t):
n, k = map(int, input().split())
a = list(map(int, input().split()))
dicto = dict()
ans = 1
for i in a:
dicto[k - i % k] = dicto.get(k - i % k, 0) + 1
ma = 0
ost = 0
for key, val in dicto.items():
if val > ma and key != k:
m... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR BIN_OP FUNC_CALL VAR BIN_OP VAR BIN_OP ... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | from sys import *
t = int(stdin.readline())
while t > 0:
n, k = map(int, stdin.readline().split())
arr = list(map(int, stdin.readline().split()))
d = dict()
d[0] = 0
for i in arr:
des = (k - i) % k
if des:
if des not in d:
d[des] = des + 1
els... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR NUMBER 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 ASSIGN VAR NUMBER NUMBER FOR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR IF VAR IF VAR VAR ASSIGN VAR VAR BIN_OP V... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | def solution(x, k):
r = {}
max_cnt, max_value = 0, 0
for t in x:
if t % k != 0:
r[k - t % k] = r.get(k - t % k, 0) + 1
if r[k - t % k] > max_cnt:
max_cnt = r[k - t % k]
max_value = k - t % k
elif r[k - t % k] == max_cnt:
... | FUNC_DEF ASSIGN VAR DICT ASSIGN VAR VAR NUMBER NUMBER FOR VAR VAR IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR BIN_OP FUNC_CALL VAR BIN_OP VAR BIN_OP VAR VAR NUMBER NUMBER IF VAR BIN_OP VAR BIN_OP VAR VAR VAR ASSIGN VAR VAR BIN_OP VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR IF VAR BIN_OP VA... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for _ in range(t):
n, k = map(int, input().split())
a = list(map(int, input().split()))
d = {}
for i in range(n):
if a[i] % k not in d:
d[a[i] % k] = 1
else:
d[a[i] % k] += 1
mx = 0
for i in d.keys():
if i != 0:
mx = ma... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR DICT FOR VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR VAR ASSIGN VAR BIN_OP VAR VAR VAR NUMBER VAR BIN_OP VAR VAR VAR NUM... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for _ in range(int(input())):
n, k = map(int, input().split())
l = list(map(int, input().split()))
d = dict()
curmax = 0
for i in l:
temp = k - i % k
if temp == k:
continue
if temp in d:
t = temp
temp += d[temp] * k
d[t] += 1
... | FOR VAR FUNC_CALL 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 ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR IF VAR VAR IF VAR VAR ASSIGN VAR VAR VAR BIN_OP VAR VA... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for i in range(int(input())):
n, k = map(int, input().split())
l = list(map(int, input().split()))
d = {}
index = 1
if k == 1:
print(0)
continue
d[0] = 0
d[1] = 0
for j in range(len(l)):
a = l[j] % k
if a in d:
d[a] += 1
else:
... | FOR VAR FUNC_CALL 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 ASSIGN VAR DICT ASSIGN VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN VAR NUMBER NUMBER ASSIGN VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR ... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for u in range(int(input())):
n, k = map(int, input().split())
a = list(map(int, input().split()))
r = []
hak = dict()
s = 0
for i in a:
tem = (i // k + 1) * k - i
if tem != k:
r.append(tem)
for i in range(len(r)):
if r[i] not in hak:
s = max(s... | FOR VAR FUNC_CALL 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 ASSIGN VAR LIST ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER VAR VAR IF VAR VAR EX... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for _ in range(int(input())):
n, k = map(int, input().split())
a = list(map(int, input().split()))
c = {}
d = {}
for i in range(n):
idx = a[i] // k * k + k - a[i]
if idx == k and a[i] != 0:
continue
if c.get(idx):
c[idx + k * d[idx]] = 1
d[... | FOR VAR FUNC_CALL 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 ASSIGN VAR DICT ASSIGN VAR DICT FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR VAR VAR VAR IF VAR VAR VAR VAR NU... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | from sys import *
for _ in range(int(stdin.readline())):
n, k = [int(x) for x in stdin.readline().split()]
v = [int(x) for x in stdin.readline().split()]
d = dict()
pasi = 0
lst = 0
for i in v:
i = k - i % k
if i == 0 or i == k:
continue
if i not in d.keys():... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR 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 FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR IF VAR NUMBER VAR VAR IF VAR FUNC_CALL VAR... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for q in range(t):
n, k = list(map(int, input().split()))
arr = list(map(int, input().split()))
dic = {}
maxi = 0
for i in range(n):
t = dic.get(arr[i] % k, 0)
if arr[i] % k == 0:
continue
else:
a = k - arr[i] % k + t * k
if a ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR 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 FUNC_CALL VAR ASSIGN VAR DICT ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR BIN_OP VAR VAR VAR NUMBER IF BIN... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | import sys
input = sys.stdin.readline
for _ in range(int(input())):
n, k = map(int, input().split())
l = list(map(int, input().split()))
ll = {}
for i in l:
t = i % k
if t != 0:
try:
ll[t] += 1
except:
ll[t] = 1
if ll:
... | IMPORT ASSIGN VAR VAR FOR VAR FUNC_CALL 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 ASSIGN VAR DICT FOR VAR VAR ASSIGN VAR BIN_OP VAR VAR IF VAR NUMBER VAR VAR NUMBER ASSIGN VAR VAR NUMBER IF VAR ASSIGN VAR F... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | from sys import stdin, stdout
input = stdin.readline
print = stdout.write
for _ in range(int(input())):
n, k = map(int, input().split())
a = list(map(int, input().split()))
d = {}
b = 0
for i in a:
c = k - i % k
if c < k:
if c in d:
d[c] += 1
... | ASSIGN VAR VAR ASSIGN VAR VAR FOR VAR FUNC_CALL 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 ASSIGN VAR DICT ASSIGN VAR NUMBER FOR VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR IF VAR VAR IF VAR VAR VAR VAR NUM... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | T = int(input())
for tc in range(T):
n, k = map(int, input().split())
a = list(map(int, input().split()))
d = dict()
mc = 0
mn = 0
for i in range(len(a)):
a[i] = k - a[i] % k
if a[i] != k:
if not d.get(a[i]):
d[a[i]] = 1
if mc == 0:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR VAR BIN_OP VAR BIN_... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | def main():
t = int(input())
for _ in range(t):
x, y = input().split()
x = int(x)
y = int(y)
z = list(map(int, input().split()))
dict = {(g % y): (0) for g in set(z)}
maxi = 0
for g in z:
if g % y != 0:
dict[g % y] += y - g % y ... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR VAR NUMBER VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER FOR VAR V... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | T = int(input().rstrip())
for tt in range(T):
n, k = list(map(int, input().rstrip().split(" ")))
arr = list(map(int, input().rstrip().split(" ")))
hsh = {}
for i in arr:
val = i % k
if val != 0:
hsh[val] = hsh.get(val, 0) + 1
if len(hsh) == 0:
print(0)
con... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR DICT FOR VAR VAR ASSIGN VAR BIN_OP VAR VAR IF VAR NUMBER ASSIG... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for _ in range(int(input())):
n, k = map(int, input().split())
a = list(map(int, input().split()))
d = {}
for i in range(n):
x = k - a[i] % k
if x in d:
d[x] += 1
elif x < k:
d[x] = 1
cnt = 0
key = 0
for i in d:
if d[i] >= cnt:
... | FOR VAR FUNC_CALL 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 ASSIGN VAR DICT FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR VAR IF VAR VAR VAR VAR NUMBER IF VAR VAR ASSIGN VAR VAR NUMBER ASSI... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for i in range(t):
[n, k] = list(map(int, input().split()))
a = list(map(int, input().split()))
l = dict()
s = set()
for j in range(n):
if -a[j] % k in l:
l[-a[j] % k] += 1
else:
l[-a[j] % k] = 1
s.add(-a[j] % k)
m = 0
idx ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN LIST VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR VAR VAR BIN_OP... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for tc in range(t):
n, k = map(int, input().strip().split())
a = list(map(int, input().strip().split()))
d = {}
for i in a:
v = k - i % k
if v in d:
d[v] += 1
else:
d[v] = 1
ans = 0
for i in d:
if i < k:
ans = m... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR 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 DICT FOR VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR IF VAR VAR VAR VAR NUMBER ASSIGN VAR VAR NUMBE... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for i in range(int(input())):
n, k = map(int, input().split())
a = list(map(int, input().split()))
for j in range(n):
a[j] = k - a[j] % k
if a[j] == k:
a[j] = 0
a.sort()
res = a[0]
cnt = 1
for j in range(1, n):
if a[j] < 1:
cnt = 0
... | FOR VAR FUNC_CALL 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 FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR BIN_OP VAR BIN_OP VAR VAR VAR IF VAR VAR VAR ASSIGN VAR VAR NUMBER EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMB... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
while t:
n, k = map(int, input().split(" "))
arr = list(map(int, input().split(" ")))
s = {}
for i in arr:
if i % k:
temp = k - i % k
else:
temp = i % k
if temp in s:
s[temp] += 1
else:
s[temp] = 1
max_c... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR 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 DICT FOR VAR VAR IF BIN_OP VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP VAR VAR IF VAR VAR VAR VAR NUMBE... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for _ in range(int(input())):
n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n):
a[i] = a[i] % k
a.sort()
p = 0
while a[p] == 0:
p += 1
if p == n:
break
x = 0
i = n - 1
while i >= p:
pre = k - a[i]
... | FOR VAR FUNC_CALL 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 FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER WHILE VAR VAR NUMBER VAR NUMBER IF VAR VAR ASSIGN... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for _ in range(int(input())):
n, k = map(int, input().split())
a = list(map(int, input().split()))
dp = {}
flag = 0
for i in a:
if i % k != 0 and k - i % k in dp:
dp[k - i % k] = dp[k - i % k] + 1
flag = 1
elif i % k != 0:
dp[k - i % k] = 1
... | FOR VAR FUNC_CALL 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 ASSIGN VAR DICT ASSIGN VAR NUMBER FOR VAR VAR IF BIN_OP VAR VAR NUMBER BIN_OP VAR BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR BIN_OP V... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | R = lambda: map(int, input().split())
(t,) = R()
for i in range(t):
n, k = R()
a = [(i % k) for i in R()]
a.sort()
m = 1
nu = a[0]
n = 1
for j in range(len(a) - 1):
if a[j] == 0:
nu = a[j + 1]
continue
if a[j] == a[j + 1]:
n += 1
el... | ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR BIN_OP VAR VAR VAR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR NUMBER IF VAR VAR N... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for i in range(t):
n, k = list(map(int, input().split()))
arr = list(map(int, input().split()))
lis = [0] * n
for j in range(n):
if arr[j] % k != 0:
lis[j] = k - arr[j] % k
lis.sort()
ans = 0
a = 1
for j in range(n):
if j != 0 and lis[j] != 0:... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR 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 FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR NUMBER ASSIGN VAR VAR BIN_OP VAR BI... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for _ in range(t):
n, k = map(int, input().split())
a = list(map(int, input().split()))
dic = {}
for i in range(n):
s = a[i] % k
if s == 0:
continue
if s in dic:
dic[s] += 1
else:
dic[s] = 1
if len(dic) == 0:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR DICT FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR VAR VAR IF VAR NUMBER IF VAR VAR VAR VAR NUMBER ASSIGN VAR VAR NUMB... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | def mostFrequent(arr, n):
arr.sort()
max_count = 1
res = arr[0]
curr_count = 1
for i in range(1, n):
if arr[i] == arr[i - 1]:
curr_count += 1
else:
if curr_count >= max_count:
max_count = curr_count
res = arr[i - 1]
... | FUNC_DEF EXPR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR IF VAR VAR VAR BIN_OP VAR NUMBER VAR NUMBER IF VAR VAR ASSIGN VAR VAR ASSIGN VAR VAR BIN_OP VAR NUMBER ASSIGN VAR NUMBER IF VAR VAR ASSIGN VAR VAR ASSIGN VAR VAR BIN_OP VAR NUMBER RETURN VAR FUNC_DEF A... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for _ in range(t):
n, k = map(int, input().split())
d = {}
ans = 0
a = list(map(int, input().split()))
for i in a:
if i % k != 0:
c = k - i % k
if c not in d:
d[c] = 0
d[c] += 1
m = 0
l = []
for i in d:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR DICT ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR VAR IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR IF VAR VAR ASSIGN VAR V... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | def countFreq(arr, n, mp):
for i in range(n):
mp[arr[i]] = mp[arr[i]] + 1 if arr[i] in mp.keys() else 1
return mp
for _ in range(int(input())):
n, k = map(int, input().split())
a, b = list(map(int, input().split())), [0] * n
for i in range(n):
b[i] = a[i] % k
d, e = countFreq(b... | FUNC_DEF FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR VAR VAR FUNC_CALL VAR BIN_OP VAR VAR VAR NUMBER NUMBER RETURN VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR 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 BIN_OP LIST NUMBER VAR... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for _ in range(0, int(input())):
n, k = map(int, input().split())
a = list(map(int, input().split()))
rem_count = {}
for i in range(len(a)):
if a[i] % k != 0:
target = k - a[i] % k
rem_count[target] = rem_count.get(target, 0) + 1
if len(rem_count) == 0:
print(... | FOR VAR FUNC_CALL VAR NUMBER 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 ASSIGN VAR DICT FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR NUMBER ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR VAR ASSIGN VAR VA... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for i in range(t):
n, k = map(int, input().split())
lst = list(map(int, input().split()))
lst1 = []
dic = {}
for j in lst:
rem = j % k
if rem != 0:
dic[k - j % k] = 0
for j in lst:
rem = j % k
if rem != 0:
dic[k - j % k] +=... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR DICT FOR VAR VAR ASSIGN VAR BIN_OP VAR VAR IF VAR NUMBER ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR NUMBER FOR... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for nt in range(int(input())):
n, k = map(int, input().split())
new = list(map(int, input().split()))
a = []
for i in range(n):
if new[i] % k != 0:
a.append(new[i])
a.sort()
n = len(a)
if n == 0:
print(0)
continue
d = {}
maxx = 0
for i in range... | FOR VAR FUNC_CALL 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 ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR NUMBER EXPR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for i in range(t):
a, b = map(int, input().split())
l = list(map(int, input().split()))
ll = []
for i in range(a):
if not l[i] % b == 0:
ll.append(l[i] % b)
ll.sort()
if len(ll) == 0:
print(0)
else:
d = ll[0]
ma = 1
mi = 1
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR IF ... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for z in range(int(input())):
n, k = list(map(int, input().split()))
arr = list(map(int, input().split()))
a = {}
ans = 0
for i in arr:
g = i % k
if g != 0:
if k - g not in a:
a[k - g] = 0
a[k - g] += 1
if len(a) == 0:
print(0)
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL 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 FUNC_CALL VAR ASSIGN VAR DICT ASSIGN VAR NUMBER FOR VAR VAR ASSIGN VAR BIN_OP VAR VAR IF VAR NUMBER IF BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP VAR VA... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | def solve():
n, k = list(map(int, input().split()))
count = {}
a = list(map(int, input().split()))
for i in range(0, n):
addition = k - a[i] % k
if addition == k:
continue
if addition not in count:
count[addition] = 1
elif a[i] % k != 0:
... | FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR DICT ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR VAR IF VAR VAR IF VAR VAR ASSIGN VAR VAR NUMBER IF BIN_OP VAR VAR VAR NUMBER VAR VAR NU... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for i in range(t):
n, k = map(int, input().split())
lst, arr = [], []
lst = list(map(int, input().split()))
for i in range(n):
if lst[i] % k != 0:
arr += [k - lst[i] % k]
else:
arr += [0]
d = {}
for i in range(n):
if arr[i] not in ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR LIST LIST ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR NUMBER VAR LIST BIN_OP VAR BIN_OP VAR VAR VAR VAR LIST NUM... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for test in range(int(input())):
n, k = map(int, input().split())
mod = {}
for i in list(map(int, input().split())):
tmp = i % k
if tmp in mod:
mod[tmp] += 1
else:
mod[tmp] = 1
mod[0] = 0
max_value = max(mod.values())
final_dict = [k for k, v in mo... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR DICT FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR VAR IF VAR VAR VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | cases = int(input())
for i in range(cases):
l1 = input().split(" ")
n = int(l1[0])
k = int(l1[1])
arr = []
l2 = input().split(" ")
for a in l2:
arr.append(int(a))
moves = 0
d = {}
divisible = 0
for num in arr:
if num % k != 0:
m = num % k
m... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR LIST ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING FOR VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR DICT ... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | def getKeysByValue(dictOfElements, valueToFind):
listOfKeys = list()
listOfItems = dictOfElements.items()
for item in listOfItems:
if item[1] == valueToFind:
listOfKeys.append(item[0])
return listOfKeys
t = int(input())
ans = []
for i in range(t):
n, k = input().split()
n =... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR VAR IF VAR NUMBER VAR EXPR FUNC_CALL VAR VAR NUMBER RETURN VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR F... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | def f(ai, k):
return (k - ai % k) % k
t = int(input())
for tt in range(t):
n, k = [int(x) for x in input().split(" ")]
a = [int(x) for x in input().split(" ")]
returns = [0] * n
for i in range(n):
returns[i] = f(a[i], k)
sall = set()
da = {}
for i in range(n):
sall.add(... | FUNC_DEF RETURN BIN_OP BIN_OP VAR BIN_OP VAR VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR 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 BIN_OP LIST NUMBER VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for case in range(t):
n, k = map(int, input().split())
a = list(map(int, input().split()))
dif = [(i % k) for i in a if i % k != 0]
if not dif:
count = 0
else:
freq = {}
most = 0
for num in dif:
if num not in freq.keys():
f... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR VAR VAR VAR BIN_OP VAR VAR NUMBER IF VAR ASSIGN VAR NUMBER ASSIGN VAR DICT ASSIGN VAR NUMBER FOR VAR VAR IF V... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
a, b = list(map(int, input().split()))
n = list(map(int, input().split()))
D = {}
for el in n:
x = el % b
if x not in D:
D[x] = 1
else:
D[x] += 1
biggest = 0
for key in D:
... | IMPORT ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR 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 FUNC_CALL VAR ASSIGN VAR DICT FOR VAR VAR ASSIGN VAR BIN_OP VAR VAR IF VAR VAR ASSIGN VAR VAR NUMBER VAR VAR ... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for _ in range(int(input())):
n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n):
a[i] %= k
a[i] = (k - a[i]) % k
a.sort()
j = 0
cnt = 1
while j < n:
if a[j] != 0:
break
j += 1
b = []
i = j + 1
while ... | FOR VAR FUNC_CALL 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 FOR VAR FUNC_CALL VAR VAR VAR VAR VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR VAR VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER WHILE VA... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for _ in range(int(input())):
n, k = map(int, input().split())
a = list(map(int, input().split()))
t = {}
ans = 0
for i in a:
if i % k > 0:
t[k - i % k] = t.get(k - i % k, 0) + 1
ans = max(ans, t[k - i % k])
ansF = 0
for i in t.keys():
if t[i] == ans:
... | FOR VAR FUNC_CALL 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 ASSIGN VAR DICT ASSIGN VAR NUMBER FOR VAR VAR IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR BIN_OP FUNC_CALL VAR BIN_OP VAR BIN_OP... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
while t > 0:
n, k = map(int, input().split())
l = list(map(int, input().split()))
d = {}
i = 0
while i != len(l):
if l[i] % k == 0:
i += 1
else:
d[k - l[i] % k] = d.get(k - l[i] % k, 0) + 1
i += 1
if len(d) == 0:
print(... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR NUMBER 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 DICT ASSIGN VAR NUMBER WHILE VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR NUMBER VAR NUMBER ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR V... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | import sys
T = int(sys.stdin.readline())
for _ in range(T):
n, k = map(int, sys.stdin.readline().split())
list_num = list(map(int, sys.stdin.readline().split()))
list_remainder = [(k - num % k if num % k else 0) for num in list_num]
dict_visit = {}
ans = 0
for num in list_remainder:
if ... | IMPORT ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR VAR BIN_OP VAR BIN_OP VAR VAR NUMBER VAR VAR ASSIGN VAR DICT ASSIGN VAR NUMBER FOR VAR VAR IF VAR IF V... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | def solve(arr, n, k, ans):
mods = {}
for i in range(n):
arr[i] %= k
arr[i] = (k - arr[i]) % k
if arr[i] != 0:
if arr[i] not in mods.keys():
mods[arr[i]] = 0
mods[arr[i]] += 1
if not mods:
ans.append(0)
return
dist_mods = []
... | FUNC_DEF ASSIGN VAR DICT FOR VAR FUNC_CALL VAR VAR VAR VAR VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR VAR VAR VAR IF VAR VAR NUMBER IF VAR VAR FUNC_CALL VAR ASSIGN VAR VAR VAR NUMBER VAR VAR VAR NUMBER IF VAR EXPR FUNC_CALL VAR NUMBER RETURN ASSIGN VAR LIST FOR VAR FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR VAR EXPR FUNC_CALL ... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | a = int(input())
for i in range(a):
leng, k = map(int, input().split())
a = list(map(int, input().split()))
count = {}
for i in a:
if i % k == 0:
continue
if count.get(k - i % k, 0):
count[k - i % k] += 1
else:
count.update({(k - i % k): 1})
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR DICT FOR VAR VAR IF BIN_OP VAR VAR NUMBER IF FUNC_CALL VAR BIN_OP VAR BIN_OP VAR VAR NUMBER VAR BIN_OP VAR BIN_OP VAR VA... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for i in range(t):
n, k = map(int, input().split())
di = dict()
mx = 0
for j in input().split():
x = (k - int(j) % k) % k
if x:
cnt = di.get(x, 0)
mx = max(mx, cnt + x)
di[x] = cnt + k
if mx:
print(mx + 1)
else:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP FUNC_CALL VAR VAR VAR VAR IF VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CA... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for _ in range(int(input())):
n, k = map(int, input().split())
ar = list(map(int, input().split()))
ar = [(k - ar[i] % k) for i in range(n)]
ar = [i for i in ar if i != k]
n = len(ar)
if not ar:
print(0)
continue
ar.sort()
prv = ar[0]
i = 1
while i < n:
cn... | FOR VAR FUNC_CALL 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 ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR VAR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR IF VAR EXPR FUNC_CALL V... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for _ in range(t):
n, k = list(map(int, input().strip().split()))
list1 = list(map(int, input().strip().split()))
for i in range(len(list1)):
if list1[i] % k == 0:
list1[i] = 0
else:
list1[i] = k - list1[i] % k
m = dict()
for i in range(len(li... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for _ in range(t):
n, k = map(int, input().split())
a = list(map(int, input().split()))
b = []
for i in range(len(a)):
if a[i] % k != 0:
b.append(k - a[i] % k)
if b == []:
print(0)
continue
b.sort()
last = -1
l = 0
c = []
for i... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR BIN_OP VAR VAR V... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
for _ in range(t):
n, k = map(int, input().split())
arr = list(map(int, input().split()))
dict = {}
for i in range(n):
t = arr[i] % k
if t != 0:
t = k - t
if t in dict.keys():
if t != 0:
dict[t] += 1
else:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR DICT FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR VAR VAR IF VAR NUMBER ASSIGN VAR BIN_OP VAR VAR IF VAR FUNC_CALL VA... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
while t > 0:
n, k = [int(ele) for ele in input().split()]
a = [int(ele) for ele in input().split()]
mem = {}
for i in range(n):
if a[i] % k == 0:
continue
if k - a[i] % k in mem.keys():
mem[k - a[i] % k] += 1
else:
mem[k - a[i]... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR NUMBER 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 DICT FOR VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR NUMBER IF BIN_OP VAR BIN_OP VAR VAR VAR FUNC_CALL VAR VAR BIN_OP VAR BIN_OP VAR VA... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | t = int(input())
while t != 0:
n, k = map(int, input().split())
list1 = list(map(int, input().split()))
list2 = list()
dicto = {}
for i in range(n):
list2.append(k - list1[i] % k)
if k - list1[i] % k in dicto.keys():
if list1[i] % k == 0:
continue
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR NUMBER 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 ASSIGN VAR DICT FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR BIN_OP VAR VAR VAR IF BIN_OP VAR BIN_OP VAR... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for testcase in range(int(input())):
n, k = map(int, input().split())
a = list(map(int, input().split()))
d = {}
m = my = 0
for ai in a:
y = (k - ai % k) % k
if y == 0:
continue
if y in d:
d[y] += 1
else:
d[y] = 1
if d[y] > ... | FOR VAR FUNC_CALL 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 ASSIGN VAR DICT ASSIGN VAR VAR NUMBER FOR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP VAR VAR VAR IF VAR NUMBER IF VAR VAR VAR VAR NUMBER ASSIGN V... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for i in range(int(input())):
n, k = map(int, input().split())
data = list(map(int, input().split()))
process = dict()
x = 0
for j in range(n):
try:
process[k - data[j] % k] += 1
except:
process[k - data[j] % k] = 1
try:
process.pop(k)
except:
... | FOR VAR FUNC_CALL 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 ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR VAR BIN_OP VAR BIN_OP VAR VAR VAR NUMBER ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | for _ in range(int(input())):
n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
final = []
for i in a:
if i % k != 0:
final.append(i)
if len(final) == 0:
print(0)
else:
h = k
new_arr = []
d = dict()
track... | FOR VAR FUNC_CALL 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 EXPR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR VAR IF BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR NUMB... |
You are given an array $a$ consisting of $n$ positive integers.
Initially, you have an integer $x = 0$. During one move, you can do one of the following two operations: Choose exactly one $i$ from $1$ to $n$ and increase $a_i$ by $x$ ($a_i := a_i + x$), then increase $x$ by $1$ ($x := x + 1$). Just increase $x$ by $... | import sys
ii = lambda: sys.stdin.readline().strip()
idata = lambda: [int(x) for x in ii().split()]
def solve():
n, k = idata()
data = idata()
slov, ans = {}, 0
for i in range(n):
data[i] = k - data[i] % k
if data[i] not in slov:
slov[data[i]] = 1
else:
... | IMPORT ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR DICT NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR BIN_OP VAR BIN_OP VAR VAR VAR IF VAR VAR VAR ASSIGN VAR VAR VAR NUMBER VAR VAR VAR NUMBER ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.