solution
stringlengths 11
983k
| difficulty
int64 0
21
| language
stringclasses 2
values |
---|---|---|
#include <bits/stdc++.h>
using namespace std;
int main() {
int num, l, r, d, x;
x = 0;
cin >> num;
for (int i = 0; i < num; i++) {
cin >> l >> r >> d;
x = d;
while (true) {
if (x <= r && x >= l) {
x = ceil((double)r / d) * d;
if (x == r) x += d;
break;
} else
break;
}
cout << x << endl;
}
return 0;
}
| 7 | CPP |
for t in range(int(input())):
l,r,d=map(int,input().split())
if d<l:
print(d)
else:
print(((r//d)+1)*d) | 7 | PYTHON3 |
import sys
input = sys.stdin.readline
q = int(input())
for _ in range(q):
l, r, d = map(int, input().split())
if d < l:
print(d)
else:
print(r // d * d + d) | 7 | PYTHON3 |
import math as mt
import sys, string
from collections import Counter, defaultdict
input = sys.stdin.readline
# input functions
I = lambda : int(input())
M = lambda : map(int, input().split())
ARR = lambda: list(map(int, input().split()))
def printARR(arr):
for e in arr:
print(e, end=" ")
print()
def main():
l, r, d = M()
if d < l:
print(d)
else:
ans = (r+(d-r%d))
print(ans)
tc = 1
tc = I()
for _ in range(tc):
main() | 7 | PYTHON3 |
t=int(input())
for i in range(t):
s=list(map(int,input().split(" ")))
l=s[0]
r=s[1]
d=s[2]
if(d<l):
print(d)
else:
k=(r+1)//d
rm=(r+1)%d
#print(k)
if(rm==0):
print(r+1)
else:
print((k+1)*d) | 7 | PYTHON3 |
t=int(input())
for i in range(t):
a,b,c=map(int,input().split())
if c<a or c>b:
print(c)
else:
d=b//c
print(c*(d+1)) | 7 | PYTHON3 |
def read():
return int(input())
def reads():
return [int(x) for x in input().split()]
N=int(input())
table=[]
for i in range(N):
l,r,d=reads()
table.append((l,r,d))
for l,r,d in table:
if d<l:
print(d)
else:
print((r//d + 1)*d) | 7 | PYTHON3 |
for i in range(int(input())):
l, r, d = [int(x) for x in input().split()]
print(d if d < l else r - (r % d) + d) | 7 | PYTHON3 |
for i in range(int(input())) :
l,r,d = map(int,input().split())
if l > d:
print(d)
else :
j=r-r%d+d
print(j) | 7 | PYTHON3 |
q = int(input())
for k in range(q):
l, r, d = map(int, input().split())
if d < l:
print(d)
else:
print(r + d - r%d) | 7 | PYTHON3 |
q = int(input())
result = []
for _ in range(q):
l, r, d = map(int, input().strip().split())
# between l and r
if d < l or d > r:
result.append(d)
continue
m = r // d
res = d * (m + 1)
result.append(res)
for i in result:
print(i)
| 7 | PYTHON3 |
#include <bits/stdc++.h>
int q, l, r, d;
int main() {
scanf("%d", &q);
while (q--) {
scanf("%d%d%d", &l, &r, &d);
if (l > d)
printf("%d\n", d);
else
printf("%d\n", r / d * d + d);
}
}
| 7 | CPP |
def mi():
return map(int, input().split())
'''
5
2 4 2
5 10 4
3 10 1
1 2 3
4 6 5
'''
for _ in range(int(input())):
l,r,d = mi()
nl=d
nr=r-r%d
nr+=d
if nl<l:
print (nl)
else:
print (nr)
| 7 | PYTHON3 |
q=int(input())
for _ in range(0,q):
l,r,n=map(int,input().split())
if(n<l):
div=l//n
rem=l%n;
if(rem==0):
ans=l-n*(div-1)
else:
ans=l-rem
rem=ans%n
div=ans//n
l=ans
if(rem==0):
ans=l-n*(div-1)
elif(n>r):
ans=n;
elif(n==r):
ans=2*n
elif(n<r):
rem=r%n
if(rem==0):
ans=r+n
else:
div=r//n
ans=(div+1)*n
print(ans)
| 7 | PYTHON3 |
n=int(input())
for i in range(n):
l,r,d=map(int, input().split())
if (l//d)>=2 or ((l//d)==1 and (l%d)!=0):
print(d)
else:
print((r//d+1)*d)
| 7 | PYTHON3 |
#include <bits/stdc++.h>
int main() {
int a1, b, c, d, n, k = 4;
std::cin >> n;
int a[n];
int i, i1, j;
for (i = 1; i <= n; i++) {
std::cin >> a1 >> b >> c;
if (a1 > c) {
std::cout << c << '\n';
} else {
std::cout << c * (b / c + 1) << '\n';
}
}
}
| 7 | CPP |
import sys
import math
def read_int():
return int(input().strip())
def read_int_list():
return list(map(int,input().strip().split()))
def read_string():
return input().strip()
def read_string_list(delim=" "):
return input().strip().split(delim)
###### Author : Samir Vyas #######
###### Write Code Below #######
q = read_int()
for _ in range(q):
[l,r,d] = read_int_list()
if d < l:
print(d)
continue
if d > r:
print(d)
continue
temp = (l//d - 1)*d
if temp < l and temp >= d:
print(temp)
continue
temp = (r//d + 1)*d
if temp > r and temp >= d:
print(temp)
continue
| 7 | PYTHON3 |
# Lets goto the next level
# AIM Specialist at CF *__* asap
# template taken from chaudhary_19
# Remember you were also a novice when you started,
# hence never be rude to anyone who wants to learn something
# Never open a ranklist untill and unless you are done with solving problems, wastes 3/4 minuts
# Donot treat CP as a placement thing, love it and enjoy it, you will succeed for sure.
# Any doubts or want to have a talk, contact https://www.facebook.com/chaudhary.mayank
# ///==========Libraries, Constants and Functions=============///
import sys
from bisect import bisect_left,bisect_right,insort
from collections import deque,Counter
from math import gcd,sqrt,factorial,ceil,log10,log2
from itertools import permutations
from heapq import heappush,heappop,heapify
inf = float("inf")
mod = 1000000007
#sys.setrecursionlimit(10**5)
def factorial_p(n, p):
ans = 1
if n <= p // 2:
for i in range(1, n + 1):
ans = (ans * i) % p
else:
for i in range(1, p - n):
ans = (ans * i) % p
ans = pow(ans, p - 2, p)
if n % 2 == 0:
ans = p - ans
return ans
def nCr_p(n, r, p):
ans = 1
while (n != 0) or (r != 0):
a, b = n % p, r % p
if a < b:
return 0
ans = (ans * factorial_p(a, p) * pow(factorial_p(b, p), p - 2, p) * pow(factorial_p(a - b, p), p - 2, p)) % p
n //= p
r //= p
return ans
def prime_sieve(n):
"""returns a sieve of primes >= 5 and < n"""
flag = n % 6 == 2
sieve = bytearray((n // 3 + flag >> 3) + 1)
for i in range(1, int(n**0.5) // 3 + 1):
if not (sieve[i >> 3] >> (i & 7)) & 1:
k = (3 * i + 1) | 1
for j in range(k * k // 3, n // 3 + flag, 2 * k):
sieve[j >> 3] |= 1 << (j & 7)
for j in range(k * (k - 2 * (i & 1) + 4) // 3, n // 3 + flag, 2 * k):
sieve[j >> 3] |= 1 << (j & 7)
return sieve
def prime_list(n):
"""returns a list of primes <= n"""
res = []
if n > 1:
res.append(2)
if n > 2:
res.append(3)
if n > 4:
sieve = prime_sieve(n + 1)
res.extend(3 * i + 1 | 1 for i in range(1, (n + 1) // 3 + (n % 6 == 1)) if not (sieve[i >> 3] >> (i & 7)) & 1)
return res
def binary(number): # <----- calculate the no. of 1's in binary representation of number
result=0
while number:
result=result+1
number=number&(number-1)
return result
def is_prime(n):
"""returns True if n is prime else False"""
if n < 5 or n & 1 == 0 or n % 3 == 0:
return 2 <= n <= 3
s = ((n - 1) & (1 - n)).bit_length() - 1
d = n >> s
for a in [2, 325, 9375, 28178, 450775, 9780504, 1795265022]:
p = pow(a, d, n)
if p == 1 or p == n - 1 or a % n == 0:
continue
for _ in range(s):
p = (p * p) % n
if p == n - 1:
break
else:
return False
return True
def all_factors(n):
"""returns a sorted list of all distinct factors of n"""
small, large = [], []
for i in range(1, int(n**0.5) + 1, 2 if n & 1 else 1):
if not n % i:
small.append(i)
large.append(n // i)
if small[-1] == large[-1]:
large.pop()
large.reverse()
small.extend(large)
return small
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
# ///===========MAIN=============///
n=int(input())
for i in range(n):
l,r,d=get_ints()
if d<l or d>r:
print(d)
else:
print(ceil((r+1)/d)*d)
| 7 | PYTHON3 |
q = int(input())
s = 0
for i in range(0,q):
e = list(map(int,input().split()))
s = e[2]
if (s>=e[0]) and (s<=e[1]):
print(s + e[1] - e[1] % s)
else:
print(s) | 7 | PYTHON3 |
import math
q = int(input())
for i in range(q):
l, r, d = map(int, input().split())
if d < l or d > r:
print(d)
elif (r+1) % d == 0:
print(r+1)
else:
print(r+1 - ((r+1) % d) + d)
| 7 | PYTHON3 |
n = int(input())
for _ in range(n):
a = list(map(int,input().split()))
l = a[0]
r = a[1]
d = a[2]
if l<=d and d<=r:
print((r//d+1)*d)
else:
print(d) | 7 | PYTHON3 |
q = int(input())
for i in range(q):
l, r, d = map(int, input().split())
if d < l:
print(d)
else:
print(r - r % d + d)
| 7 | PYTHON3 |
n = int(input())
for i in range(n) :
a,b,c = map(int,input().split())
if(a / c > 1) :
print(c)
else :
print(((b//c)+1) *c )
| 7 | PYTHON3 |
for _ in[0]*int(input()):p,q,r=map(int,input().split());print((r>=p)*q//r*r+r)
| 7 | PYTHON3 |
for _ in range(int(input())):
l,r,d=map(int,input().split())
if d<l:
print(d)
else:
print((r//d +1)*d)
| 7 | PYTHON3 |
q = int(input())
for i in range(q):
firstlastnum = list(map(int, input().split()))
first = firstlastnum[0]
last = firstlastnum[1]
num = firstlastnum[2]
div2 = last // num
if num < first:
print(num)
else:
print(div2*num + num)
| 7 | PYTHON3 |
n = int(input())
a = []
for i in range(n):
l, r, d = map(int, input().split())
a.append([l, r, d])
for i in a:
l, r, d = list(i)
if d < l:
print(d)
else:
c = r // d
print((c + 1) * d)
| 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int solve(int l, int r, int d) {
if (d >= l) {
return (r / d + 1) * d;
} else {
return d;
}
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int q;
cin >> q;
for (int i = 0; i < q; i++) {
int l, r, d;
cin >> l >> r >> d;
cout << solve(l, r, d) << endl;
}
}
| 7 | CPP |
n = int(input())
for i in range(n):
a, b, c = [int(i) for i in input().split()]
if a<=c <=b:
print((b//c+1)*c)
else:
print(c) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
for (T e : v) {
os << e << ' ';
}
return os;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int q;
cin >> q;
while (q--) {
ll l, r, d;
cin >> l >> r >> d;
if (d < l) {
cout << d << '\n';
} else {
ll candidate = (r / d) * d;
candidate += d;
cout << candidate << '\n';
}
}
return 0;
}
| 7 | CPP |
# @author Nayara Souza
# UFCG - Universidade Federal de Campina Grande
# AA - Basico
q = int(input())
for i in range(q):
x = list(map(int,input().split()))
if x[2] < x[0]:
print(x[2])
else:
y = (x[1] // x[2]) + 1
print(y*x[2])
| 7 | PYTHON3 |
q = int(input())
for x in range(q):
l, r, d = map(int, input().split())
if d < l or d > r:
print(d)
else:
print((r // d + 1) * d) | 7 | PYTHON3 |
ansarr=[]
q=int(input())
for l in range(q):
l,r,d=map(int,input().split())
if(l>d):
ansarr.append(d)
else:
if(r%d==0):
ansarr.append(r+d)
else:
val=r//d
ansarr.append((val+1)*d)
print(*ansarr)
| 7 | PYTHON3 |
for _ in range(int(input())):
l,r,d=map(int,input().split())
if(d<l):
print(d)
continue
else:
x=(r+1)%d
if(x==0):
d=0
print(r+1+(d-x))
| 7 | PYTHON3 |
from math import ceil
def slve(l,r,d):
if (l-1)//d>=1:return d
return ceil((r+1)/d)*d
for _ in range(int(input())):
l,r,d=map(int,input().split());print(slve(l,r,d)) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, l, r, d, i, f = 0, j;
cin >> x;
int* Arr = (int*)malloc(3 * x * sizeof(int));
int z;
for (z = 0; z < 3 * x; z++) {
cin >> Arr[z];
}
int mod;
for (i = 0; i < x; i++) {
l = Arr[i * 3];
r = Arr[3 * i + 1];
d = Arr[3 * i + 2];
n = d;
f = 0;
if (n < l || n > r)
cout << d << endl;
else {
mod = r % n;
n = n + r - mod;
cout << n << endl;
}
}
free(Arr);
return 0;
}
| 7 | CPP |
from sys import stdin
n=int(stdin.readline().strip())
for i in range(n):
s=list(map(int,stdin.readline().strip().split()))
if s[0]>s[2]:
print(s[2])
continue
x=s[1]//s[2]
x+=1
print(x*s[2])
| 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
long long q, a, b, d;
int main() {
cin >> q;
while (q--) {
cin >> a >> b >> d;
if (d < a)
cout << d << endl;
else
cout << ((b / d) + 1) * d << endl;
}
}
| 7 | CPP |
import sys
tc = int(sys.stdin.readline())
for _ in range(tc):
l, r, d = map(int, sys.stdin.readline().split())
left = (l // d) * d if l % d == 0 else ((l // d) + 1) * d
right = (r // d) * d
if d < l or d > r:
print(d)
else:
temp = []
if l <= left <= r and left - d > 0:
temp.append(left - d)
if l <= right <= r and right + d > 0:
temp.append(right + d)
if not temp:
temp.append(d)
temp.sort()
print(temp[0]) | 7 | PYTHON3 |
#include <bits/stdc++.h>
const double pi = 4.0 * atan(1.0);
const double e = exp(1.0);
using namespace std;
const int N = 3e6 + 5;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long n;
cin >> n;
while (n--) {
long long a, b, c;
cin >> a >> b >> c;
if (a > c) {
cout << c << endl;
continue;
}
long long x = b / c;
x++;
cout << c * x << endl;
}
}
| 7 | CPP |
# ===================================
# (c) MidAndFeed aka ASilentVoice
# ===================================
# import math
# import collections
# import string
# ===================================
n = int(input())
for _ in range(n):
l, r, d = [int(x) for x in input().split()]
ans = d
if l <= ans <= r:
ans = (r+d-1) // d * d
if ans == r:
ans += d
print(ans) | 7 | PYTHON3 |
n = int(input())
for i in range(0,n):
a = list(map(int,input().split()))
if(a[0] == a[2] or a[0] == 1):
num = a[1] +1
if(a[1] == a[2] and a[0] == a[1]):
print(2*a[1])
elif(a[1] == 1):
print(a[2])
elif(a[2] % a[1] == 0):
print(a[1]+a[2])
else:
while(1):
if(num % a[2] == 0):
print(num)
break
num += 1
else:
num = a[2]
while(1):
if num not in range(a[0],a[1]+1):
print(num)
break
num += a[2]
| 7 | PYTHON3 |
n = int(input())
for i in range(n):
l, r, d = map(int, input().split())
if(d < l or d > r):
print(d)
else:
print((r // d) * d + d) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
long long int t;
cin >> t;
while (t--) {
long long int l, r, d, i, x, y, z;
cin >> l >> r >> d;
if (l > d) {
cout << d << endl;
} else if (r % d == d) {
cout << d << endl;
} else {
x = r / d;
y = (x * d);
z = y + d;
cout << z << endl;
}
}
return 0;
}
| 7 | CPP |
for t in range(int(input())):
l, r, d = map(int,input().split())
if d < l:
print(d)
else:
print(r+d-r%d)
| 7 | PYTHON3 |
# cook your dish here
n=int(input())
for h in range(0,n):
a,b,c=map(int,input().split(" "))
if a<=c and c<=b:
u=(b-(b%c))+c
print(u)
else:
print(c)
| 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
long long modexpo(long long x, long long p) {
long long res = 1;
x = x % 1000000007;
while (p) {
if (p % 2) res = res * x;
p >>= 1;
x = x * x % 1000000007;
res %= 1000000007;
}
return res;
}
long long max(long long a, long long b) { return (a > b ? a : b); }
long long min(long long a, long long b) { return (a < b ? a : b); }
struct edge {
long long u, v, w;
edge(long long a, long long b, long long c) {
u = a;
v = b;
w = c;
}
};
struct compare {
bool operator()(const edge a, const edge b) const {
if (a.u == b.u) {
if (a.v == b.v) {
return a.w < b.w;
}
return a.v < b.v;
}
return a.u < b.u;
}
};
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long t;
cin >> t;
while (t--) {
long long l, r, d;
cin >> l >> r >> d;
if (d < l) {
cout << d << "\n";
} else if (r % d == 0) {
cout << r + d << "\n";
} else {
long long x = ceil((long double)r / (long double)d);
cout << x * d << "\n";
}
}
}
| 7 | CPP |
for _ in range(int(input())):
l, r, d = map(int, input().split())
print(d if d < l else r + d - r % d) | 7 | PYTHON3 |
q=int(input())
for i in range(0,q):
l,r,d=map(int,input().split())
if(d<l or d>r):
print(d)
else:
print(d*((r//d)+1))
| 7 | PYTHON3 |
num = int(input())
queries = []
for i in range(0, num):
queries.append(list(map(int, input().split(' '))))
for i in range(0, num):
d = queries[i][2]
l = queries[i][0]
r = queries[i][1]
n = d
while(True):
if n % d == 0:
if n < l or n > r:
print(n)
break
elif n >= l and n <= r:
n += r - n
n += d - (n % d)
| 7 | PYTHON3 |
for _ in range(int(input())):
l,r,d=list(map(int,input().strip().split()))
x=d
if d<l:
print(x)
continue
print(((r//d)+1)*d)
| 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long INF = 1e18;
const long long MAXN = 25;
long long l, r, d, n;
long long myceil(long long x, long long y) {
if ((x % y) == 0) {
return x / y + 1;
} else {
return x / y + 1;
}
}
int main() {
{
scanf("%lld", &n);
for (long long i = 1; i <= n; i++) {
scanf("%lld %lld %lld", &l, &r, &d);
if (l <= d && d <= r) {
long long be = myceil(r, d);
printf("%lld\n", (be)*d);
} else {
printf("%lld\n", d);
}
}
}
}
| 7 | CPP |
q = int(input())
for i in range(q):
l, r, d = map(int, input().split())
rd = r//d
if d<l:
print(d)
else:
print((rd+1)*d) | 7 | PYTHON3 |
q = int(input())
for i in range(0, q):
s = input()
left = int(s.split(" ")[0])
right = int(s.split(" ")[1])
d = int(s.split(" ")[2])
div = 1
if d * div in range(left, right + 1):
div = int(right / d) + 1
print(d * div)
| 7 | PYTHON3 |
q = int(input())
for _ in range(q):
l, r, d = map(int, input().split())
if (d<l or d>r):
print(d)
else:
Q = r//d
R = r%d
print(d*(Q+1)) | 7 | PYTHON3 |
for i in range(int(input())):
l,r,d = map(int,input().split())
if l<=d:
print((d-(r%d))+r)
else:
print(d) | 7 | PYTHON3 |
def ii():
return int(input())
def mi():
return map(int, input().split())
def li():
return list(mi())
for _ in range(ii()):
l, r, d = mi()
ans = d
if l <= d <= r:
ans = d * (r // d + 1)
print(ans)
| 7 | PYTHON3 |
q = int(input())
ans = []
for i in range(q):
l, r, d = map(int, input().split())
if d < l or d > r:
ans.append(d)
else:
ans.append(r - r % d + d)
for i in ans:
print(i) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int a[1000100];
int c[1000010];
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; ++i) {
int l, r, d;
scanf("%d%d%d", &l, &r, &d);
if (d < l) {
printf("%d\n", d);
} else {
long long x2 = r / d;
while (x2 * d <= r) {
x2++;
}
printf("%lld\n", x2 * d);
}
}
}
| 7 | CPP |
"""
βββ βββββββ βββ βββββββ βββββββ βββ ββββββ
βββββββββββββββ βββββββββββββββββββββββββββββ
ββββββ ββββββ ββββββββββββββββββββββββββββ
ββββββ ββββββ βββββββ βββββββββ βββ βββββββ
βββββββββββββββ βββββββββββββββββ βββ βββββββ
βββ βββββββ βββ ββββββββ βββββββ βββ ββββββ
__ __ _
| \/ (_)_ __ ___ _ __
| |\/| | | '__/ _ \| '_ \
| | | | | | | (_) | | | |
|_| |_|_|_| \___/|_| |_|
"""
"""
ΠΡΠ°ΡΠΈΠ²ΠΎΠ΅ Π»ΡΡΡΠ΅, ΡΠ΅ΠΌ ΡΡΠΎΠ΄Π»ΠΈΠ²ΠΎΠ΅.
Π―Π²Π½ΠΎΠ΅ Π»ΡΡΡΠ΅, ΡΠ΅ΠΌ Π½Π΅ΡΠ²Π½ΠΎΠ΅.
ΠΡΠΎΡΡΠΎΠ΅ Π»ΡΡΡΠ΅, ΡΠ΅ΠΌ ΡΠ»ΠΎΠΆΠ½ΠΎΠ΅.
Π‘Π»ΠΎΠΆΠ½ΠΎΠ΅ Π»ΡΡΡΠ΅, ΡΠ΅ΠΌ Π·Π°ΠΏΡΡΠ°Π½Π½ΠΎΠ΅.
ΠΠ»ΠΎΡΠΊΠΎΠ΅ Π»ΡΡΡΠ΅, ΡΠ΅ΠΌ Π²Π»ΠΎΠΆΠ΅Π½Π½ΠΎΠ΅.
Π Π°Π·ΡΠ΅ΠΆΠ΅Π½Π½ΠΎΠ΅ Π»ΡΡΡΠ΅, ΡΠ΅ΠΌ ΠΏΠ»ΠΎΡΠ½ΠΎΠ΅.
Π§ΠΈΡΠ°Π΅ΠΌΠΎΡΡΡ ΠΈΠΌΠ΅Π΅Ρ Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅.
ΠΡΠΎΠ±ΡΠ΅ ΡΠ»ΡΡΠ°ΠΈ Π½Π΅ Π½Π°ΡΡΠΎΠ»ΡΠΊΠΎ ΠΎΡΠΎΠ±ΡΠ΅, ΡΡΠΎΠ±Ρ Π½Π°ΡΡΡΠ°ΡΡ ΠΏΡΠ°Π²ΠΈΠ»Π°.
ΠΡΠΈ ΡΡΠΎΠΌ ΠΏΡΠ°ΠΊΡΠΈΡΠ½ΠΎΡΡΡ Π²Π°ΠΆΠ½Π΅Π΅ Π±Π΅Π·ΡΠΏΡΠ΅ΡΠ½ΠΎΡΡΠΈ.
ΠΡΠΈΠ±ΠΊΠΈ Π½ΠΈΠΊΠΎΠ³Π΄Π° Π½Π΅ Π΄ΠΎΠ»ΠΆΠ½Ρ Π·Π°ΠΌΠ°Π»ΡΠΈΠ²Π°ΡΡΡΡ.
ΠΡΠ»ΠΈ ΠΎΠ½ΠΈ Π½Π΅ Π·Π°ΠΌΠ°Π»ΡΠΈΠ²Π°ΡΡΡΡ ΡΠ²Π½ΠΎ.
ΠΡΡΡΠ΅ΡΠΈΠ² Π΄Π²ΡΡΠΌΡΡΠ»Π΅Π½Π½ΠΎΡΡΡ, ΠΎΡΠ±ΡΠΎΡΡ ΠΈΡΠΊΡΡΠ΅Π½ΠΈΠ΅ ΡΠ³Π°Π΄Π°ΡΡ.
ΠΠΎΠ»ΠΆΠ΅Π½ ΡΡΡΠ΅ΡΡΠ²ΠΎΠ²Π°ΡΡ ΠΎΠ΄ΠΈΠ½ ΠΈ, ΠΆΠ΅Π»Π°ΡΠ΅Π»ΡΠ½ΠΎ, ΡΠΎΠ»ΡΠΊΠΎ ΠΎΠ΄ΠΈΠ½ ΠΎΡΠ΅Π²ΠΈΠ΄Π½ΡΠΉ ΡΠΏΠΎΡΠΎΠ± ΡΠ΄Π΅Π»Π°ΡΡ ΡΡΠΎ.
Π₯ΠΎΡΡ ΠΎΠ½ ΠΏΠΎΠ½Π°ΡΠ°Π»Ρ ΠΌΠΎΠΆΠ΅Ρ Π±ΡΡΡ ΠΈ Π½Π΅ ΠΎΡΠ΅Π²ΠΈΠ΄Π΅Π½, Π΅ΡΠ»ΠΈ Π²Ρ Π½Π΅ Π³ΠΎΠ»Π»Π°Π½Π΄Π΅Ρ [^1].
Π‘Π΅ΠΉΡΠ°Ρ Π»ΡΡΡΠ΅, ΡΠ΅ΠΌ Π½ΠΈΠΊΠΎΠ³Π΄Π°.
Π₯ΠΎΡΡ Π½ΠΈΠΊΠΎΠ³Π΄Π° Π·Π°ΡΠ°ΡΡΡΡ Π»ΡΡΡΠ΅, ΡΠ΅ΠΌ ΠΏΡΡΠΌΠΎ ΡΠ΅ΠΉΡΠ°Ρ.
ΠΡΠ»ΠΈ ΡΠ΅Π°Π»ΠΈΠ·Π°ΡΠΈΡ ΡΠ»ΠΎΠΆΠ½ΠΎ ΠΎΠ±ΡΡΡΠ½ΠΈΡΡ β ΠΈΠ΄Π΅Ρ ΠΏΠ»ΠΎΡ
Π°.
ΠΡΠ»ΠΈ ΡΠ΅Π°Π»ΠΈΠ·Π°ΡΠΈΡ Π»Π΅Π³ΠΊΠΎ ΠΎΠ±ΡΡΡΠ½ΠΈΡΡ β ΠΈΠ΄Π΅Ρ, Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ, Ρ
ΠΎΡΠΎΡΠ°.
ΠΡΠΎΡΡΡΠ°Π½ΡΡΠ²Π° ΠΈΠΌΡΠ½ β ΠΎΡΠ»ΠΈΡΠ½Π°Ρ ΡΡΡΠΊΠ°! ΠΡΠ΄Π΅ΠΌ Π΄Π΅Π»Π°ΡΡ ΠΈΡ
Π±ΠΎΠ»ΡΡΠ΅!
"""
"""
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
"""
"""
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
"""
"""
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@#@@#@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@##@M@M # #@@@M@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@@@#@@ @@@@@@M@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@# #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
"""
"""
/ \ //\
|\___/| / \// \\
/0 0 \__ / // | \ \
/ / \/_/ // | \ \
@_^_@'/ \/_ // | \ \
//_^_/ \/_ // | \ \
( //) | \/// | \ \
( / /) _|_ / ) // | \ _\
( // /) '/,_ _ _/ ( ; -. | _ _\.-~ .-~~~^-.
(( / / )) ,-{ _ `-.|.-~-. .~ `.
(( // / )) '/\ / ~-. _ .-~ .-~^-. \
(( /// )) `. { } / \ \
(( / )) .----~-.\ \-' .~ \ `. \^-.
///.----..> \ _ -~ `. ^-` ^-_
///-._ _ _ _ _ _ _}^ - - - - ~ ~-- ,.-~
/.-~
"""
"""
____ _ _____
/ ___|___ __| | ___| ___|__ _ __ ___ ___ ___
| | / _ \ / _` |/ _ \ |_ / _ \| '__/ __/ _ \/ __|
| |__| (_) | (_| | __/ _| (_) | | | (_| __/\__ \
\____\___/ \__,_|\___|_| \___/|_| \___\___||___/
"""
"""
βββββββββββββββββββ
ββββββββββββββββββββ
ββββββββββββββββββββ
ββββββββββββββββββββ
ββββββββββββββββββββ
ββββββββββββββββββββ
ββββββββββββββββββββ
ββββββββββββββββββββ
ββββββββββββββββββββ
ββββββββββββββββββββ
ββββββββββββββββββββ
ββββββββββββββββββββ
ββββββββββββββββββββ
"""
"""
n = int(input())
os=0
ch=[]
for i in range(n):
m = int(input())
ch.append(m)
if ch[0]==10:
if 1 in ch:
print((len( ch[:ch.index(1)])))
break
else:
if 10 in ch:
print((len( ch[:ch.index(10)])))
break
"""
"""
n,m = map(int,input().split())
m = float(m)
mi = []
for i in range(n):
a,b = map(float,input().split())
mi.append((a*m)/b)
print(round(min(mi),6))
"""
"""
l = input().split()
l = set(l)
print(len(l))
"""
"""
x = input()
y = x[1:-1]
z = set(y.split(', '))
if x == "{}":
print(0)
else:
print(len(z))
"""
"""
n,k = map(int,input().split())
L = sorted(map(int, input().split()))
res = [L[0]]
for i in range(1,n):
if L[i] != L[i-1]:
res.append(L[i]-L[i-1])
l = len(res)
if k > l:
res += [0]*(k-l)
for i in range(k):
print(res[i])
"""
"""
from math import*
s,k = map(int,input().split(" "))
sq = input().split()
score = 0
pol = ""
for i in range(len(sq)):
if sq[i]>=sq[i-1]:
score+=1
print(ceil(score/len(sq))+ceil(score/len(sq)))
"""
"""
from math import*
s,k = map(int,input().split(" "))
sq = input().split()
score = 0
pol = ""
for i in range(len(sq)):
if sq[i]>=sq[i-1]:
score+=1
print(ceil(score/len(sq))+ceil(score/len(sq)))
"""
"""
st=list(input().split('+'))
st.sort()
for i in range(len(st)):
if i!=len(st)-1:
print(str(st[i])+'+',end='')
else:
print(str(st[i]))
"""
"""
a = input()
up = a.upper()
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(abc[abc.find(up[0])]+a[1::])
"""
"""
n= int(input())
k = 0
for i in range(n):
p = input()
if p == "++X" or p == "X++":
k+=1
elif p == "--X" or p == "X--":
k-=1
print(k)
"""
"""
import math
c = 1
l = int(input())
g = ""
for i in range(l):
for s in range(1,l - i + 1):
g = g + " "
for j in range(0,i + 1):
if(i == 0 or j == 0):
c = 1
else:
c = c * (i - j + 1)/j
t = c
T=0
while(t != 0):
T = T + 1
t = int(math.floor(t/10))
p=0
while((p+T)!=4):
g = g + " "
p=p+1
g = g + str(int(math.floor(c)))
g = g + "\n"
print(g)
"""
"""
___ __ _ _
|_ _|_ __ / _| ___ _ __ _ __ ___ __ _| |_(_) ___ ___
| || '_ \| |_ / _ \| '__| '_ ` _ \ / _` | __| |/ __/ __|
| || | | | _| (_) | | | | | | | | (_| | |_| | (__\__ \
|___|_| |_|_| \___/|_| |_| |_| |_|\__,_|\__|_|\___|___/
"""
"""
from math import*
a1 = float(input())
a2 = float(input())
b = sqrt(a1**2 + a2**2)
print(b)
"""
"""
a1 = float(input())
a2 = float(input())
b = (a1**2 + a2**2)
import math
l = math.sqrt(b)
print(l)
"""
"""
n = int(input())
a=list(map(int,input().split(" ")))
b = []
for i in range(len(a)):
if i%2==0:
print(a[i],end=' ')
"""
"""
n = int(input())
a=list(map(int,input().split(" ")))
b = []
for i in range(len(a)):
if a[i]%2==0:
print(a[i],end=' ')
"""
"""
n = int(input())
a=list(map(int,input().split(" ")))
b = []
for i in range(len(a)):
if a[i]>0:
b.append(a[i])
print(len(b))
"""
"""
n = int(input())
a=list(map(int,input().split(" ")))
b = 0
for i in range(1,n):
if a[i]>a[i-1]:
b+=1
print(b)
"""
"""
n = int(input())
a=list(map(int,input().split(" ")))
b = 0
for i in range(1,n):
if a[i]>a[i-1]:
b+=1
print(b)
"""
"""
n = int(input())
a=list(map(int,input().split(" ")))
b = 0
for i in range(n-1):
if i == 0:
pass
elif a[i]>a[i-1]and a[i+1]< a[i]:
b+=1
print(b)
"""
"""
n = int(input())
a=list(map(int,input().split(" ")))
a.reverse()
for i in a:
print(i,end = " ")
"""
"""
n = int(input())
a=list(map(int,input().split(" ")))
print(max(a))
"""
"""
n = int(input())
a = list(map(int,input().split(" ")))
l = 0
q = []
for i in range(len(a)):
if a[i] in q:
pass
else:
l +=1
q.append(a[i])
print(l)
"""
"""
n = int(input())
a = list(map(int,input().split()))
x = int(input())
k =1
for i in range(len(a)):
k+=1
if x > a[i]:
print(i+1)
exit()
print(k)
"""
"""
a=list(map(int,input().split(" ")))
b = []
for i in range(len(a)):
if i%2==0:
print(a[i],end=' ')
"""
"""
a=list(map(int,input().split(" ")))
b = 0
for i in range(len(a)-1):
if i == 0:
pass
elif a[i]>a[i-1]and a[i+1]< a[i]:
b+=1
print(b)
"""
"""
a = list(map(int,input().split()))
print(max(a),a.index(max(a)))
"""
"""
ch = list(input())
if ch.count("h")>=1 and ch.count("e")>=1 and ch.count("l")>=2 and ch.count("o")>=1 and len(ch)!=53:
print("YES")
else:
print("NO")
"""
"""
from decimal import Decimal
x,y = map(Decimal,input().split(" "))
d = 1
while x < y and x - y < 0.000001 :
x += x * 70 / 100
d += 1
print(d)
"""
"""
n = int(input())
abc = "abcdefghijklmnopqrstuvwxyz"
s =""
for i in range(n):
k,v = map(int,input().split())
for i in range(k):
while len(s) <= k:
s += abc[:v]
if len(s)>k:
s = s[:-(len(s)-k)]
print(s,end="\n")
s=""
"""
"""
k = int(input())
l = int(input())
m = int(input())
n = int(input())
d = int(input())
lst = []
lst.append(k)
lst.append(l)
lst.append(m)
lst.append(n)
uron = 0
for i in range(len(lst)):
if d % lst[i] == 0:
uron+=lst[i]
print(uron)
"""
"""
n = int(input())
a = list(map(int,input().split()))
ch = 0
nch = 0
for i in range(len(a)):
if a[i] % 2 == 0:
ch+=1
else:
nch+=1
if ch > nch:
for i in range(len(a)):
if a[i] % 2 == 1:
print(a.index(a[i])+1)
else:
for i in range(len(a)):
if a[i]%2==0:
print(a.index(a[i])+1)
"""
"""
n,t = map(int,input().split())
oc = input()
for i in range (1,n):
if oc[i]=="B":
oc[i]=oc[i-1]
print(oc)
"""
"""
n = int(input())
o = 0
for i in range(n):
o += ((n-2) - (n % 2))//2
print(o)
"""
"""
sl = input()
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
m=0
b=0
big = ""
for i in range(len(sl)):
if sl[i]== abc[abc.find(sl[i])]:
b+=1
else:
m +=1
if m>b:
big += sl.lower()
print(big)
elif b>m:
big += sl.upper()
print(big)
elif b==m:
big += sl.lower()
print(big)
"""
"""
n = int(input())
a = list(map(int,input().split()))
for i in range(n):
print(a.index(i+1)+1, end=' ')
"""
"""
n = int(input())
if n % 2 == 0 and n != 2 :
print("YES")
else:
print("NO")
"""
"""
a = input().replace("WUB"," ")
print(a)
"""
"""
a = int(input())
b = list(map(int,input().split()))
b.sort()
for i in b:
print(i,end=" ")
"""
"""
a,b = map(int,input().split())
o = 0
if a % 2 == 0:
o = a//2
else:
o = (a//2)+1
if b <= o:
print((1+((o-1)*2)))
else:
print(((o-1)*2))
"""
"""
a,b = map(int,input().split())
year = 0
while b>=a:
a*=3
b*=2
year+=1
print(year)
"""
"""
n,m = map(int,input().split())
m = float(m)
mi = []
for i in range(n):
a,b = map(float,input().split())
mi.append((a*m)/b)
print(min(mi))
"""
"""
n = int(input())
x = 0
for i in range(n):
a = input()
if a == "Tetrahedron":
x+=4
elif a == "Cube":
x+=6
elif a == "Octahedron":
x+=8
elif a == "Dodecahedron":
x+=12
elif a == "Icosahedron":
x+=20
print(x)
"""
"""
n= int(input())
a = list(map(int,input().split()))
for i in a:
if sum(a)>0:
print("HARD")
break
else:
print("EASY")
break
"""
"""
a,b = map(int,input().split())
c = list(map(int,input().split()))
bal = 0
for i in range(1,len(c)+1):
if b == len(c):
if c[i]>=c[b-1]:
bal +=1
else:
if c[i]>=c[b] and c[i]!= 0:
bal+=1
print(bal)
"""
"""
a,b =map(int, input().split())
y=list(map(int,input().split()))
for i in y:
if i<y[b-1] or i==0:
a-=1
print(a)
"""
"""
a,b=map(int,input().split())
c=b-(a+1)//2
if c > 0:
print(2*c)
else:
print(2*b-1)
"""
"""
a = input()
b = input()
a1 = a.lower()
b1 = b.lower()
o = 0
k = 0
if a1>b1:
o+=1
if b1>a1:
k+=1
print(o-k)
"""
"""
n=int(input())
p=input().split()
q=input().split()
m = p[1:]
j = q[1:]
if len(set(m+j))==n:
print("I become the guy.")
else:
print("Oh, my keyboard!")
"""
"""
a = set(input())
for i in range(len(a)):
a.remove()
if a == "hello":
print("YES")
else:
print("NO")
"""
"""
n = list(map(int,input()))
a = n.count(4)+n.count(7)
if a == 7 or a == 4:
print("YES")
else:
print("NO")
"""
"""
n = int(input())
b = input()
b = b.upper
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(len(b)):
if abc[i] in b:
print("YES")
else:
print("NO")
"""
"""
from math import*
n,a,b = list(map(int,input().split()))
pos = 0
for i in range(n):
if (a + b) % 2 == 0:
print(a+b)
break
else:
print(ceil((a+b)/2))
break
"""
"""
n = int(input())
ans = 0
for i in range(n):
a,b,c = map(str,input().split())
b = int(b)
for i in range(n):
if b == -b and c == "YES":
print("Impossible")
elif ans > b and c == "Y":
ans += 1
elif ans < b and c == "Y":
ans+=1
elif ans >= b and c == "Y":
ans+=1
elif ans <= b and c == "Y":
ans+=1
elif ans > b and c == "N":
break
elif ans < b and c == "N":
break
elif ans >= b and c == "N":
break
elif ans <= b and c == "N":
break
print(ans)
"""
"""
from math import*
n,k = map(int,input().split())
a = list(map(int,input().split()))
com = 0
for i in range(len(a)):
if a[i]+2 <= 5:
com += 0.333
print(ceil(com))
"""
"""
n,a,b = map(int,input().split())
d = []
s = 0
k = 1
for i in range(n-1):
if a == 0 and b == 0:
print(n)
exit()
d.append("*"*((a+i)) +"+"+"*"*(((b-i)-k)))
if len(d[i])<=n:
s+=1
print(s)
"""
"""
n,h =map(int, input().split())
for i in map(int, input().split()):
if i > h:
n+=1
print(n)
"""
"""
n = input()
a = input()
if a.count('A')> a.count('D'):
print('Anton')
elif a.count('A')<a.count('D'):
print('Danik')
else:
print('Friendship')
"""
"""
n = int(input())
a=[]
for i in range(n):
a.append(list(map(int,input().split())))
g = list(map(sum,a))
count=0
i=0
for j in g:
if j >=2:
count+=1
print(count)
"""
"""
n=int(input())
x=input()
c=0
for i in range(n-1):
if x[i] == x[i+1]:
c+=1
print(c)
"""
"""
k = list(map(int,input().split()))
t = input()
kal = 0
for i in range(len(t)):
if t[i]=="1":kal += k[0]
elif t[i]=="2":kal += k[1]
elif t[i]=="3":kal += k[2]
elif t[i] == "4":kal += k[3]
print(kal)
"""
"""
orient = input()
key = input()
keyboard = "poiuytrewq;lkjhgfdsa/.,mnbvcxz"
ans = ""
for i in range(len(key)):
if orient == "R":
ans += keyboard[keyboard.find(key[i])+1]
elif orient == "L":
ans += keyboard[keyboard.find(key[i])-1]
print(ans)
"""
"""
n,k = map(int, input().split())
abc = "abcdefghijklmnopqrstuvwxyz"
f = abc[:k]
s = f
while len(s) < n:
s += f
s = s[:n]
print(s)
"""
"""
n = int(input())
if n %2 == 0 or n == 2:
print("YES")
else:
print("NO")
"""
"""
mas = 0
while 1:
try:
a = input()
if ":" in a:
mas += len(a[a.find(":"):])
except EOFError:
print(mas)
"""
"""
a = input()
b = input()
c = str(int(a)+int(b))
if int(a.replace("0",""))+int(b.replace("0",""))== int(c.replace("0","")):
print("YES")
else:
print("NO")
"""
"""
s = input()
w = len(s)
n=int(input())
b=[]
for i in range(n):
wd=input()
if wd[:w]==s:
b.append(wd)
b.sort()
if len(b)==0:
print(s)
else:
print(min(b))
"""
"""
n = int(input())
ans = 0
for i in range(n):
x,a = map(int,input().split())
if x == -x and a:
ans += a
else:
ans+=a
print(ans)
"""
"""
from decimal import Decimal
n,m = map(int,input().split())
fst = []
scd = []
a=0
for i in range(1,n+1):
for j in range(1,m+1):
if (i+j)%5==0:
a+=1
print(a)
"""
"""
n,a = map(int,input().split())
ans = ""
for i in range(n):
b = list(map(str,input().split()))
for j in range(a):
if b[j] != "B" or b[j]!="W"or b[j]!="G":
ans += "#Color"
break
else:
ans += "#Black&White"
break
print(ans)
"""
"""
n=int(input())
num=0
a , b =[],[]
for i in range(n):
c=input().split()
a.append(c[0])
b.append(c[1])
for i in a:
num+=b.count(i)
print(num)
"""
"""
n = int(input())
b = input()
a = b.lower()
if a.count("a")>=1 and a.count("b")>=1 and a.count("c")>=1 and a.count("d")>=1 and a.count("e")>=1 and a.count("f")>=1 and a.count("g")>=1 and a.count("h")>=1 and a.count("i")>=1 and a.count("j")>=1 and a.count("k")>=1 and a.count("l")>=1 and a.count("m")>=1 and a.count("n")>=1 and a.count("o")>=1 and a.count("p")>=1 and a.count("q")>=1 and a.count("r")>=1 and a.count("s")>=1 and a.count("t")>=1 and a.count("u")>=1 and a.count("v")>=1 and a.count("w")>=1 and a.count("x")>=1 and a.count("y")>=1 and a.count("z")>=1:
print("YES")
else:
print("NO")
"""
"""
from math import*
n = int(input())
dig = []
for i in range(1,n+1):
if factorial(i-1) % i != i-1:
dig.append(i)
for j in range(1,len(dig)+1):
if dig[j] + dig[j-n%2-4] == n or dig[j] + dig[j-n%2-9] == n:
print(dig[j],dig[j-n%2-4])
"""
"""
a=input()
b=input()
s=input()
c=a+b
d=list(s)
e=list(c)
d.sort()
e.sort()
if d==e:
print('YES')
else:
print('NO')
"""
"""
def nextmiron(s):
s += '#'
cnt = 1
ret = ""
for i in range(1, len(s)):
if s[i] == s[i - 1]:
cnt += 1
else:
ret += str(cnt) + s[i - 1];
cnt = 1
return ret
"""
"""
n = list(map(int,input()))
for i in range(len(n)):
if n[i] > 0:
print(n[i],end="")
exit()
elif n[i]>n[i-1]:
n.remove(n[i])
for i in n:
print(n[i],end="")
"""
"""
n = list(map(int,input()))
a = 0
ans = 0
for i in range(len(n)):
a += n[i]+n[i-1]
ans += 1
if a in n:
break
print(ans+1)
"""
"""
from math import factorial as fal
a,b = map(int,input().split())
ans = 0
p = []
prime = []
for i in range(a,b+1):
if fal(i-1) % i == i-1:
p.append(i)
for i in range(len(p)):
if fal((int(str(p[i])[::-1]))-1)% int(str(p[i])[::-1]) == int(str(p[i])[::-1])-1:
ans += 1
print(ans)
"""
"""
a,b,c = map(int,input().split())
d = str(a/b)
if len(d)==3:
print(d+"0"*(c-1))
else:
print(round((a/b),c))
"""
"""
a = list(input())
n = 0
h = 'hello'
for i in range(len(a)):
if a[i] == h[n]:
n += 1
if n >= 5:
break
if n >= 5:
print('YES')
else:
print('NO')
"""
"""
from math import factorial as fal
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
if fal(i-1) % i == i-1 and fal((int(str(i)[::-1]))-1) % int(str(i)[::-1]) == int(str(i)[::-1])-1:
ans += 1
if a == 1:
print(ans - 1)
exit()
print(ans)
"""
"""
l=list(map(int,input().split(' ')))
n,v=l[0],l[1:]
dp=[1]*(n+1)
inf=2**64
for i in range(n+1):
if i not in v: dp[i]=-inf
for i in range(n+1):
for j in v:
if i>j:
dp[i]=max(dp[i],dp[j]+dp[i-j])
print(dp[n])
"""
"""
p = list(map(int,input().split()))
q = set(p)
s = 0
for i in q:
s += p.count(i)-1
print(s)
"""
"""
a,b = map(int,input().split())
h = []
l = []
for i in range(b):
c = list(map(int,input().split()))
h.append(c)
h.sort()
for i in h:
if a > i[0]:
l.append(1)
a += i[1]
if len(l) == b:
print("YES")
else:
print("NO")
"""
"""
n,m=map(int,input().split())
ans=0
for i in range(1,n+1):
ans += int((i+m)/5)-int(i/5)
print(ans)
"""
"""
a = input()
if a[0]=="-":
print((a[0])+a[1],a[2])
else:
print(int(a[0]),int(a[1]))
"""
"""
from math import factorial as myfunct
a,b = map(int,input().split())
c = min(a,b)
print(myfunct(c))
"""
"""
a,b,c = map(int,input().split())
d = []
d.append(a)
d.append(b)
d.append(c)
d.sort()
print(d[2]-d[0])
"""
"""
n=int(input())
a=list(map(int,input().split()))
b = a[:]
b.reverse()
u = a.index(max(a))
l = n-1-b.index(min(a))
if u > l:
print(u+(n-1-l)-1)
else:
print(u+(n-1-l))
"""
"""
s=input().lower()
for i in "aeiouy":
s = s.replace(i,"")
print("."+".".join(s))
"""
"""
n = int(input())
maxi = 0
mini = 0
for i in range(n):
a,b = map(int,input().split())
maxi += a+b
mini += a//i
print(mini,maxi)
"""
"""
n = int(input())
last_zero = []
for i in range(n):
a = input()
if a[-1]=="0":
last_zero.append(a)
for i in range(len(last_zero)):
if last_zero[i].count("0")>last_zero[i-1].count("0"):
print(last_zero[i])
break
"""
"""
n = int(input())
for i in range(n):
a,b = map(int,input().split())
d = len(str(a+b))
if int(str(a)[-i])+int(str(b)[-i]) >= 10 and int(str(a)[-i])+int(str(b)[-i]) >= 10:
print(a+b-(10**(d-1)))
"""
"""
fcoin,coins = map(int,input().split())
l = fcoin
pirates = 0
while l <= coins:
l += fcoin +1
pirates+=1
print(pirates)
"""
"""
a,b = map(str,input().split("+"))
roman = ["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI","XVII","XVIII","XIX","XX"]
f = roman.index(a)+1
s = roman.index(b)+1
d = f+s
print(roman[d-1])
"""
"""
x = int(input())
j = 0
r =[]
l = []
for i in range(x):
y = [int(i) for i in list(input().split())]
if y[0]<0:
l.append(y)
else:
r.append(y)
r = sorted(r)
l = sorted(l, reverse = True)
j = 0
d =1 if len(r)>=len(l) else -1
while((d == 1 and len(r)>0) or (d==-1 and len(l)>0)):
if d ==1:
j += r[0][1]
r = r[1:]
d = -1
else:
j += l[0][1]
l = l[1:]
d = 1
print(j)
"""
"""
a=int(input())
b=int(input())
c=int(input())
d=int(input())
n=int(input())
ans=0
for i in range(1,n+1):
if i%a==0 or i%b==0 or i%c==0 or i%d==0:
ans+=1
print(ans)
"""
"""
n,m = map(int,input().split( ))
for i in range(n):
if i%2==0:
print('#'*m)
elif i%4==1:
print('.'*(m-1)+'#')
else:
print('#'+'.'*(m-1))
"""
"""
n = int(input())
a = list(map(int, input().split()))
print(sum(a)/n)
"""
"""
a,b = map(int, input().split())
r1 = min(a,b)
r2 = (max(a,b) - min(a,b)) // 2
print(r1,r2)
"""
"""
a = input()
b1,b2,b3,b4,b5 = map(str,input().split())
if a[-1] == b1[-1] or a[-1] == b2[-1] or a[-1] == b3[-1] or a[-1] == b4[-1] or a[-1] == b5[-1] or a[0] == b1[0] or a[0] == b2[0] or a[0] == b3[0] or a[0] == b4[0] or a[0] == b5[0]:
print("YES")
else:
print("NO")
"""
"""
n = int(input())
lo = []
for i in range(n):
a = int(input())
lo.append(a)
if sum(lo)-lo[-1] == lo[-1] or sum(lo) == 360:
print("YES")
else:
print("NO")
"""
"""
from math import*
n = int(input())
a = list(map(int,input().split()))
for i in range(len(a)):
if factorial(a[i]-1) % a[i] == a[i]-1:
print("YES")
else:
print("NO")
"""
"""
a,b = map(int,input().split())
ans = a
if a % b == 0:
ans += a//b
if (a//b) % 2 == 0:
ans += ans % b
print(ans)
"""
"""
a,b = map(int,input().split())
print(a+b)
"""
"""
a = input()
if set(a) == "ABC" or set(a) == ".ABC" or set(a) == "ABC.":
print(1)
else:
print(2)
print(set(a))
"""
"""
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(len(a)):
if a[i] >= a[-1]:
ans += 1
print(ans)
"""
"""
n,k = map(int,input().split())
i = 0
while 1:
i+=1
if (i // k)*(i % k) == n:
print(i)
break
"""
"""
a = input()
if "ABC" in a or "ACB" in a or "BAC" in a or "BCA" in a or "CAB" in a or "CBA" in a:
print('Yes')
else:
print('No')
"""
"""
s=''
for i in range(int(input())):
s=s+input()
print(s.count('11')+s.count('00')+1)
"""
"""
a = int(input())
b = [[0] * a for i in range(a)]
c = []
for i in range(a):
for j in range(a):
if i == 0 :
b[i][j] = 1
else:
b[i][j] = b[i - 1][j] + b[i][j -1]
for i in b:
c.append(max(i))
print(max(c))
"""
"""
a,b = map(int,input().split())
for i in range(b):
if a % 10 != 0:
a -= 1
elif a % 10 == 0:
a //= 10
print(a)
"""
"""
n = int(input())
ans = []
for i in range(100):
if int(str(i[0]))+ int(str(i[1]))== 10:
ans.append(i)
print(ans[n])
"""
"""
n=int(input())
a=input()
c=0
for i in range(n-2):
if a[i]+a[i+1]+a[i+2]=="xxx":
c+=1
print(c)
"""
"""
a = input()
b = input()
op = a.find("1")
op1 = b.find("1")
op2 = min(op,op1)
if a[0] == "0" and b[0] == "0":
print("0"*len(a[:op2])+str((int(a)+int(b))).replace("2","0"))
else:
print(str((int(a)+int(b))).replace("2","0"))
"""
"""
n = int(input())
if n % 2 != 0:
print(n//2)
print('2 '*(n//2-1)+'3')
else:
print(n//2)
print('2 '*(n//2))
"""
a=int(input())
for i in range(a):
b,c,d = map(int,input().split())
if d >= min(b,c):
print(max(b,c)+(d-max(b,c)%d))
else:
print(d)
"""
n = int(input().strip())
kras = input().strip()+'W'
k = []
l = 0
for i in range(n+1):
if kras[i] == 'B':
l += 1
elif l != 0:
k.append(str(l))
l = 0
print(len(k))
print(' '.join(k))
"""
"""
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
if a[i] % 2 == 0:
a[i] = a[i] - 1
for i in a:
print(i, end = " ")
"""
"""
n,k = map(int, input().split())
s=1
d = n
while (n%10!=k and n%10!=0):
n+=d
s+=1
print(s)
"""
"""
n = int(input())
a = input()
b = []
can = 1
for i in range(n):
b.append(int(a[i]))
if a[i] != '4' and a[i] != '7':
can = 0
suma = 0
for i in range(n):
if i < n / 2:
suma += b[i]
else:
suma -= b[i]
if suma != 0 or can == 0:
print("NO")
else:
print("YES")
"""
"""
n,k = map(int,input().split())
if (n // k) % 2 == 1:
print("YES")
else:
print("NO")
"""
"""
n = int(input())
var = []
for i in range(10000):
if str(i) == str(i)[::-1] and len(str(i)) % 2 == 0 or len(str(i)) == 2:
var.append(i)
print(var[n])
"""
"""
a,b = map(int,input().split())
ans = []
tot=0
for i in range(999):
while i>0:
dig=i%10
tot+=dig
i //=10
if tot == b:
ans.append(i)
if len(ans)==0:
print(-1,-1)
exit()
print(min(ans),max(ans))
"""
"""
n = int(input())
seq = []
for i in range(1,10000):
seq.append(i*(-1)**i)
for i in range(n):
l,r = map(int,input().split())
print(sum(seq[l-1:r]))
"""
"""
from math import*
n = int(input())
a = list(map(int,input().split()))
for i in range(len(a)):
g = sqrt(a[i])
point = str(g).find(".")
if len(str(g)[point:])>2:
g = 100
if factorial(g-1) % g == g-1 and g != 1:
print("YES")
else:
print("NO")
"""
"""
n = int(input())
mishka = 0
Chris = 0
Friend = 0
for i in range(n):
a,b = map(int,input().split())
if a > b:
mishka += 1
elif b > a:
Chris += 1
elif a == b:
Friend += 1
if mishka > Chris:
print("Mishka")
elif Chris > mishka:
print("Chris")
elif Chris == mishka:
print("Friendship is magic!^^")
"""
"""
n = int(input())
ans = ["purple","green","blue","orange","red","yellow"]
ans1 = []
for i in range(n):
a = input()
ans1.append(a)
del(ans[ans.index(a)])
print(len(ans))
for i in range(len(ans)):
if ans[i] == "purple":
print("Power")
elif ans[i] == "green":
print("Time")
elif ans[i] == "blue":
print("Space")
elif ans[i] == "orange":
print("Soul")
elif ans[i] == "red":
print("Reality")
elif ans[i] == "yellow":
print("Mind")
"""
| 7 | PYTHON3 |
I=lambda:map(int,input().split())
for i in range(int(input())):
l,r,d=I()
if d<l or d>r :
print(d)
else:
print((r//d)*d+d) | 7 | PYTHON3 |
import sys
import math
from collections import defaultdict,deque
input = sys.stdin.readline
def inar():
return [int(el) for el in input().split()]
def main():
t=int(input())
for _ in range(t):
l,r,d=inar()
if l <= d <= r:
print(d*(r//d+1))
else:
print(d)
if __name__ == '__main__':
main()
| 7 | PYTHON3 |
q=int(input())
while(q>0):
l,r,d=map(int ,input().split())
i=0
if (d<l): print(d)
elif(d>r):print(d)
else:print(d*((r//d)+1))
q-=1 | 7 | PYTHON3 |
import time
#input
n = int(input(""))
l = []
r = []
d = []
for i in range(n):
a,b,c = input("").split()
l.append(int(a))
r.append(int(b))
d.append(int(c))
#process
#output
for i in range(n):
if(l[i]/d[i]>1):
print(d[i])
else:
print((r[i]//d[i]+1)*d[i])
| 7 | PYTHON3 |
import math
n = int(input())
for _ in range(n):
a,b,c = input().split()
c = int(c)
x = int(a)/c
y = int(b)/c
x = math.ceil(x-1)
y = math.floor(y+1)
if(x*c <= 0):
print(y*c)
else:
if(x>=1):
print(1*c)
| 7 | PYTHON3 |
q = int(input())
for i in range(q):
l, r, d = map(int, input().split())
if l / d <= 1:
n = 0
else:
n = 1
m = r // d + 1
if n == 0:
x = d * m
else:
x = d * n
print(x)
| 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int q, i, j, ans, l, r, d;
cin >> q;
while (q--) {
cin >> l >> r >> d;
if (d < l || d > r)
cout << d << endl;
else {
ans = 1 + r / d;
cout << ans * d << endl;
}
}
return 0;
}
| 7 | CPP |
from sys import stdin, stdout
from math import *
from heapq import *
from collections import *
def main():
q=int(stdin.readline())
for _ in range(q):
l,r,d=[int(x) for x in stdin.readline().split()]
res=0
if (d<l):
res=d
else:
res=(trunc(r/d)+1)*d
stdout.write(str(res)+"\n")
return 0
if __name__ == "__main__":
main() | 7 | PYTHON3 |
def main():
q = int(input())
ans = []
for i in range(q):
inp = input().split()
li = int(inp[0])
r = int(inp[1])
d = int(inp[2])
ii = 1
global s
s = True
if d < li:
ans.append(d)
elif d > r:
ans.append(d)
else:
ans.append((int(r / d) + 1) * d)
##if d >= r:
# ans.append(2 * d)
#elif d > li:
# ans.append((int(r / d) + 1) * d)
#else:
# while d * ii < li:
# di = d * ii
# if di > r or di < li:
# ans.append(ii)
# ii += 1
# else:
# ans.append((int(r / d) + 1) * d)
for i in range(q):
print(ans[i])
main()
| 7 | PYTHON3 |
t=int(input())
for i in range(t):
l,r,d=list(map(int,input().strip().split()))
if l>d:
print(d)
else:
print(d*(r//d+1))
| 7 | PYTHON3 |
q = int(input())
res = ''
for _ in range(q):
mult = 1
l,r,d = [int(i) for i in input().split()]
if d < l:
new = d
res += str(new) + '\n'
else:
res += str(d * (r//d + 1)) + '\n'
print(res)
| 7 | PYTHON3 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 19 15:46:43 2019
@author: umang
"""
t = int(input())
while t > 0:
t -= 1
l, r, d = map(int, input().split())
i = 1
low = l // d
high = r // d
if low == 0 or low*d == l == 1*d:
print((high+1)*d)
else:
print(d)
| 7 | PYTHON3 |
n=int(input())
for i in range(n):
l=[int(i) for i in input().split()]
if (l[2]<l[0])or(l[2]>l[1]):
print(l[2])
else :
print((int((l[1])//(l[2]))+1)*l[2]) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int q;
cin >> q;
while (q--) {
long long int l, r, d;
cin >> l >> r >> d;
if (l > d)
cout << d << "\n";
else if (r % d == 0)
cout << d + r << "\n";
else
cout << (r / d) * d + d << "\n";
}
}
| 7 | CPP |
import math
n = int(input())
for i in range(n):
l, r, d = map(int,input().split())
if d<l:
print(d)
else:
b = math.ceil(r/d)
if r % d == 0:
b += 1
print(int(b*d)) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
void fastIO() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
void solve() {
long long int l, r, d;
cin >> l >> r >> d;
if (d < l) {
cout << d << "\n";
return;
} else {
long long int rem = r % d;
rem = d - rem;
cout << r + rem << "\n";
return;
}
return;
}
int main() {
fastIO();
int q;
cin >> q;
while (q--) {
solve();
}
return 0;
}
| 7 | CPP |
from math import *
#s=['toc','c++','c','cse',"lol",'c','c++']
#s.append("hi")
#s.insert(2,"ki")
#s.remove("toc")
#s.sort()
#s.reverse()
#s.pop()
#s2=s.copy()
#k=s.index('c')
#k=s.count('cse')
#k=list(range(1,n))
#print(n[2])
#print(s2)
n=int(input())
p=0
while p<n:
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
if c<a:
print(c)
elif c>=a:
k=b//c
print((k+1)*c)
p+=1
'''
a={1,2,3,4,5}
b=set([4,5,6,7,8])
a.add(6)
if 4 in a:
print('false')
print(a)
print(a|b)
print(a&b)
print(a-b)
'''
| 7 | PYTHON3 |
q = int(input())
M = [list(map(int, input().split())) for i in range(q)]
S =[]
#x = 1
l = len(S)
for i in range(q):
x = 1
while True:
if x < M[i][0] or x > M[i][1]:
if x % M[i][2] == 0:
S.append(x)
break
else:
if x < M[i][2]:
x = M[i][2]
else:
x = x+(M[i][2]-x % M[i][2])
else:
if M[i][2] >= M[i][0]:
x = M[i][1]+1
elif M[i][2] < M[i][0]:
x = 2
for i in S:
print(i) | 7 | PYTHON3 |
n = int(input())
l = [[int(i) for i in input().split()] for i in range(n)]
for i in range(n):
if l[i][2] < l[i][0]:
print(l[i][2])
else:
print(l[i][1]//l[i][2]*l[i][2] + l[i][2])
| 7 | PYTHON3 |
q = int(input())
for i in range(q):
a = 0
l,r,d=map(int, input().split())
while True:
a += d
if d < l:
a = d
break
if l <= a <= r:
a = (r // d + 1) * d
if a % d == 0:
break
print(a)
| 7 | PYTHON3 |
q = int(input())
for i in range(q):
l,r,d = map(int,input().split())
if l > d:
print(d)
else:
print(((r//d)+1)*d)
| 7 | PYTHON3 |
import math
q=int(input())
l=[None]*q
r=[None]*q
d=[None]*q
for x in range(q):
l[x],r[x],d[x]=[int(y) for y in input().split()]
for x in range(q):
if d[x]<l[x]:
print(d[x])
else:
res=int(r[x]/d[x]) +1
print(res*d[x]) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long long l, r, d;
cin >> l >> r >> d;
long long q = r / d;
long long ans = d * (q + 1);
if (d * 1 < l) {
ans = d;
}
cout << ans << endl;
}
return 0;
}
| 7 | CPP |
def readInput():
Q = int(input())
lista = list()
for i in range(Q):
l, r, d = map(int, input().split())
lista.append([l, r, d])
return Q, lista
def solve(l, r, d):
upValue = r // d + 1
downValue = (l + d - 1) // d - 1
if (downValue <= 0):
return upValue * d
else:
return d
def solveProblem():
Q, queries = readInput()
assert Q == len(queries)
for i in range(Q):
print(solve(queries[i][0], queries[i][1], queries[i][2]))
solveProblem() | 7 | PYTHON3 |
import math
import os
import random
import re
import sys
from collections import Counter
a=[]
l=[]
n=int(input())
for i in range(n):
l+=[list(map(int,input().split()))]
for i in range(n):
if l[i][2]<=l[i][1] and l[i][2]>=l[i][0]:
print(l[i][2]*((l[i][1]//l[i][2])+1))
else:
print(l[i][2]) | 7 | PYTHON3 |
def ii():
return int(input())
def mi():
return map(int,input().split())
def li():
return list(mi())
for _ in range(ii()):
a,b,d=mi()
if (d>b or d<a):
print(d)
else:
print((b//d+1)*d) | 7 | PYTHON3 |
def answer(l, r, d):
if d < l:
out = d
else:
amari = d - (r % d)
out = r + amari
return out
q = int(input())
for i in range(q):
l, r, d = list(map(int, input().split(" ")))
print(answer(l, r, d)) | 7 | PYTHON3 |
def min_int(inp):
l = int(inp[0])
r = int(inp[1])
d = int(inp[2])
out = -1
i = 1
while out == -1 :
mult = i * d
if mult not in range(l,r+1):
out = mult
break
if mult in range(l,r+1):
mult = r
i = mult // d
i = i+1
return out
#flow of the program
q = int(input())
for i in range(0, q):
inp = input()
inp = inp.split()
minimal_integer = min_int(inp)
print(minimal_integer)
| 7 | PYTHON3 |
from math import floor
q = int(input())
while q!=0:
q-=1
a,b,c = map(int,input().split())
if c<a:
print(c)
else:
print(c*floor(b/c)+c)
| 7 | PYTHON3 |
def task():
p=input().split()
l=int(p[0])
u=int(p[1])
d=int(p[2])
if(d<l or d>u):
print(d)
else:
print (d*(1+u//d))
t=int(input())
i=0
while i<t:
task()
i+=1 | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long l, r, d, q;
cin >> q;
for (long long i = 0; i < q; i++) {
cin >> l >> r >> d;
if (l > d)
cout << d << "\n";
else
cout << (r / d + 1) * d << "\n";
}
}
| 7 | CPP |
T = int(input())
for _ in range(T):
l, r, d = (int(i) for i in input().split())
if d < l:
print(d)
else:
print(d*((r//d)+1))
| 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int q;
cin >> q;
for (int i = 0; i < q; i++) {
int d, l, r;
cin >> l;
cin >> r;
cin >> d;
bool a = false;
bool b = false;
if (int(ceil(float(l) / float(d))) == l / d) a = true;
if (int(ceil(float(r) / float(d))) == r / d) b = true;
if (a && b) {
if (l / d > 1) {
printf("%d\n", d);
} else
printf("%d\n", r + d);
} else if (!a && !b) {
if (ceil(float(l) / float(d)) > 1) {
printf("%d\n", d);
} else
printf("%d\n", int(ceil(float(r) / float(d))) * d);
} else if (!a && b) {
if (ceil(float(l) / float(d)) > 1) {
printf("%d\n", d);
} else
printf("%d\n", r + d);
} else {
if (l / d > 1) {
printf("%d\n", d);
} else
printf("%d\n", int(ceil(float(r) / float(d))) * d);
}
}
return 0;
}
| 7 | CPP |
t = int(input())
for i in range(t):
a, b, c = map(int, input().split())
if(c < a):
print(c)
elif c > b:
print(c)
else:
print(c + ((b - c) // c + 1) * c) | 7 | PYTHON3 |
q = int(input())
for i in range(q):
l, r, d = map(int, input().split())
if d < l:
print(d)
else:
print((r // d) * d + d)
| 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int N = 200005;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int q;
cin >> q;
for (int i = 0; i < q; i++) {
int l, r, d;
cin >> l >> r >> d;
if (d < l)
cout << d << "\n";
else if (r % d == 0)
cout << r + d << "\n";
else
cout << (r / d + 1) * d << "\n";
}
return 0;
}
| 7 | CPP |
#coding: UTF-8
def verificar(l,r,d):
x = d
n = int(r/d)
while( (l<= x <=r) == True):
n += 1
x = d * n
return (x)
n = int(input())
valores = []
while(n != 0):
entrada = input()
valores.append(entrada)
n = n-1
for i in valores:
j = i.split(' ')
print(verificar(int(j[0]),int(j[1]),int(j[2])))
| 7 | PYTHON3 |
q=int(input())
for _ in range(q):
l,r,d=map(int,input().split())
if l>d:
print(d)
else:
print(d*(r//d+1)) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long MAXN = 1e5 + 3;
const long long inf = 2e9;
long long max(long long a, long long b) {
if (a > b)
return a;
else
return b;
}
long long min(long long a, long long b) {
if (a < b)
return a;
else
return b;
}
long long dx[] = {1, -1, 0, 0};
long long dy[] = {0, 0, -1, 1};
bool cmp(pair<long long, long long> p1, pair<long long, long long> p2) {
if (p1.first < p2.first)
return true;
else if (p1.first == p2.first) {
if (p1.second < p2.second) return true;
return false;
}
return false;
}
void solve() {
long long n;
cin >> n;
long long li, ri, di;
for (long long i = (long long)0; i < (long long)n; ++i) {
cin >> li >> ri >> di;
long long t1 = li / di;
long long t2 = ri / di;
if (li % di == 0) t1--;
t2++;
if (t1 >= 1)
cout << di << "\n";
else
cout << t2 * di << "\n";
}
}
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long nT = 1;
for (long long i = (long long)1; i <= (long long)nT; ++i) solve();
return 0;
}
| 7 | CPP |
q = int(input())
for i in range(q):
l,r,d = map(int,input().split())
if (l > d or d > r):
print(d)
else:
print((r//d)*d+d)
| 7 | PYTHON3 |