problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p02743
s140926671
Accepted
from decimal import * a,b,c=input().split() print("Yes" if Decimal(a).sqrt()+Decimal(b).sqrt()<Decimal(c).sqrt() else "No")
p02676
s108304902
Wrong Answer
n=int(input()) s=input() if len(s)>n: nl=s[0:n] print(nl,'...') else: print(s)
p02935
s326999451
Accepted
N=int(input()) v=sorted(map(int,input().split())) value=v[0] for i in range(1,N): value=(value+v[i])/2 print(value)
p03328
s921579134
Accepted
def main(): west_tower_height, east_tower_height = map(int, input().split(" ")) east_tower_num = east_tower_height - west_tower_height print(east_tower_num * (east_tower_num + 1) // 2 - east_tower_height) if __name__ == '__main__': main()
p03160
s421551620
Accepted
n = int(input()) h = list(map(int, input().split())) dp = [10 ** 18 for _ in range(n)] dp[0] = 0 for i in range(1, n): dp[i] = min(dp[i-1] + abs(h[i] - h[i-1]), dp[i-2] + abs(h[i] - h[i-2])) print(dp[-1])
p02786
s111898806
Accepted
def hit(h): ans = 0 if h == 1: ans += 1 else: ans += 2*hit(h//2) + 1 return ans if __name__ == '__main__': print(hit(int(input())))
p03345
s857806526
Accepted
# https://atcoder.jp/contests/agc024/tasks/agc024_a a, b, c, k = map(int, input().split()) if k % 2 == 0: print(a - b) else: print(b - a)
p02718
s234303872
Accepted
n, m = map(int, input().split()) a = list(map(int, input().split())) a.sort(reverse=True) s = sum(a) if a[m-1] < s / (4*m): print('No') else: print('Yes')
p02768
s143350725
Accepted
from functools import reduce n,a,b=map(int,input().split()) DIV = 10**9 + 7 def nCr(N,R,DIV): f=lambda x,y:x*y%DIV X=reduce(f,range(N-R+1,N+1)) Y=reduce(f,range(1,R+1)) return X*pow(Y,DIV-2,DIV)%DIV print((pow(2,n,DIV) - 1 - nCr(n,a,DIV) - nCr(n,b,DIV) ) % DIV)
p02683
s621265237
Accepted
import numpy as np N, M, K = map(int, input().split()) data = np.array([list(map(int, input().split())) for _ in range(N)]) costs = data[:, 0] knows = data[:, 1:] mincost = 1e+9 for i in range(2 ** N): bits = np.array([((i >> j) & 1) for j in range(N)]) sumknows = (knows * bits[:, None]).sum(axis=0) if (sumknows >= K).all(): cost = (costs * bits).sum() mincost = min(mincost, cost) print(mincost if mincost < 1e+9 else -1)
p04020
s988999886
Accepted
import sys input = sys.stdin.readline N = int(input()) A = [int(input()) for _ in range(N)] + [0] ans = 0 for i in range(N): # できるだけ左でペアを作る Lpair = A[i] // 2 ans += Lpair A[i] -= 2 * Lpair if A[i] > 0 and A[i + 1] > 0: ans += 1 A[i] -= 1 A[i + 1] -= 1 print(ans)
p03962
s830663847
Accepted
a,b,c=map(int,input().split()) print(len(set([a,b,c])))
p03645
s677441301
Wrong Answer
N, M = map(int, input().split()) A = [list(input().split()) for i in range(M)] start = [] goal = [] for i in range(len(A)): if A[i][0] == '1': start.append(A[i]) elif A[i][1] == str(N): goal.append(A[i]) is_ok = False for j in range(len(start)): for k in range(len(goal)): if start[j][1] == goal[k][0]: is_ok = True break if is_ok: break if is_ok: print('POSSIBLE') else: print('INPOSSIBLE')
p03611
s855045780
Wrong Answer
N = int(input()) a = [int(x) for x in input().split()] M = max(a) C = [0] * (M + 1) for i in range(N): C[a[i]] += 1 ans = 0 for i in range(1,M): wa = C[i - 1] + C[i] + C[i + 1] ans = max(ans, wa) print(ans)
p03557
s367476938
Accepted
from bisect import bisect_left, bisect_right n = int(input()) a = sorted(list(map(int, input().split()))) b = sorted(list(map(int, input().split()))) c = sorted(list(map(int, input().split()))) res = 0 for i in b: res += bisect_left(a, i) * (n - bisect_right(c, i)) print(res)
p03377
s525856145
Wrong Answer
a, b, x = map(int, input().split()) if (a + b) >= x >= a: print("Yes") else: print("No")
p03723
s369958270
Accepted
A,B,C = list(map(int,input().split())) if A == B == C and A%2 == 0 : print(-1) elif A == B == C and A%2 == 1 : print(0) else : cnt=0 while A%2==B%2==C%2==0: total=A+B+C A=total//2-A//2 B=total//2-B//2 C=total//2-C//2 cnt+=1 print(cnt)
p03693
s639217118
Wrong Answer
r, g, b = map(int, input().split()) print("YES" if (r*100+g*10+b) % 4 == 0 else "No")
p03624
s100516520
Accepted
S = input() a = [True for _ in range(26)] for s in S: a[ord(s) - ord("a")] = False for i, aa in enumerate(a): if aa: print(chr(i + ord("a"))) exit() print("None")
p03037
s103417483
Accepted
N, M = map(int, input().split()) maxL = 0 minR = N-1 LR = [0, N-1] for i in range(M): LR = [int(i)-1 for i in input().split()] maxL = max(maxL, LR[0]) minR = min(minR, LR[1]) if minR-maxL>=0: print(minR-maxL+1) else: print(0)
p02948
s150462337
Accepted
import heapq n, m = map(int, input().split()) d = [[] for _ in range(m+1)] for _ in range(n): a, b = map(int, input().split()) if a < m+1: d[a].append(b) hq = [] heapq.heapify(hq) ans = 0 for i in range(1, m+1): if len(d[i]) > 0: for j in d[i]: heapq.heappush(hq, j*(-1)) if len(hq) > 0: ans += heapq.heappop(hq)*(-1) print(ans)
p03719
s988521858
Accepted
a,b,c = map(int,input().split()) if a<= c and c<=b: print("Yes") else: print("No")
p03555
s337973574
Wrong Answer
A = input() D = input() if A[0] == D[2] and A[1] == D[1] and A[2] == D[0]: print("Yes") else: print("No")
p02747
s695278445
Accepted
#n = int(input()) s = input() #a,b = map(int,input().split()) #a_L = list(map(int,input().split())) if s == "hi": print("Yes") exit() s = s.split("hi") for i in s: if i != "": print("No") exit() print("Yes") # if len(s) != 1: # print("Yes") # else: # print("No")
p03013
s709013905
Accepted
n,m=[int(i) for i in input().split()] dp=[1,1] ;a=set() ; mod=(10**9+7) for i in range(m): a.add(int(input())) if 1 in a: dp[1]=0 for i in range(2,n+1): if i not in a: dp.append((dp[-1]+dp[-2])%mod) else: dp.append(0) print(dp[-1])
p02842
s000775100
Accepted
# coding: utf-8 N = int(input()) x_ = N//1.08 ans = ':(' for i in range(1,100000): x = x_+i if int(1.08*x) == N: ans = int(x) break print(ans)
p03696
s151836072
Wrong Answer
def main(): n = int(input()) s = input().replace(')(', ') (').split() ans = '' for a in s: tmp = a lc = a.count('(') rc = a.count(')') if lc < rc: ans = '('*(rc - lc) + ans elif rc < lc: tmp += ')'*(lc - rc) ans += tmp print(ans) if __name__ == "__main__": main()
p02552
s119075876
Wrong Answer
''' Created on 2020/09/13 @author: okazakieiichiro ''' num = input() if num == 0: print(1) else: print(0)
p03699
s166637213
Wrong Answer
N = int(input()) S = [int(input()) for _ in range(N)] total = sum(S) for s in S: if total % 10 != 0: print(total) break else: total -= s else: print(total)
p03000
s876635319
Wrong Answer
n, x = map(int, input().split()) ns = list(map(int, input().split())) d = 0 count = 0 for i in range(n): if d <= x: d += ns[i] count += 1 else: break print(count)
p02778
s893429031
Accepted
S = len(input()) ans = "" for i in range(S): ans += "x" print(ans)
p03103
s403025303
Accepted
n,m = map(int,input().split()) p,x = 0,0 l = [tuple(map(int,input().split())) for i in range(n)] l.sort() for a in l: if m-a[1]>=1: p+=a[0]*a[1] m-=a[1] else: p+=a[0]*m m=0 break print(p)
p02571
s009848091
Accepted
S = list(input()) T = list(input()) def kakikae_count(S_i): count = 0 for i in range(len(T)): if S[S_i + i] != T[i]: count += 1 return count min_count = len(T) for i in range(0, len(S) - len(T) + 1): need_count = kakikae_count(i) if need_count < min_count: min_count = need_count print(min_count)
p03612
s625959169
Accepted
import sys N = int(sys.stdin.readline()) P = list(map(int, sys.stdin.readline().split())) ans = 0 for i, p_i in enumerate(P): if p_i == i + 1: if i + 1 == N: P[i], P[i-1] = P[i-1], P[i] else: P[i+1], P[i] = P[i], P[i+1] ans += 1 print(ans)
p02993
s625106836
Accepted
S = input() ans = "Good" for i in range(3): if S[i] == S[i + 1]: ans = "Bad" print(ans)
p03206
s444686566
Wrong Answer
D = int(input()) if D == 25: a = 'Christmas' elif D == 24: a = 'Christmas Eve' elif D == 23: a = 'Christmas Eve Eve' elif D == 22: a = 'christmas Eve Eve Eve' print(a)
p02801
s190733924
Wrong Answer
chr1 = input(chr) new = ord(chr1)+1 print(chr(new))
p03317
s273223670
Accepted
n,k=map(int,input().split()) a=list(map(int,input().split())) aa=min(a) n-=k import math q=0 if n%(k-1)==0: q+=n//(k-1) else: q+=n//(k-1)+1 print(q+1)
p02900
s476024349
Wrong Answer
import math A, B = map(int, input().split()) def f(n): p_lis = [] temp = n for i in range(2, int(math.sqrt(n)) + 1): if temp % i == 0: while temp % i == 0: temp //= i p_lis.append(i) if temp != 1: p_lis.append(temp) if p_lis == []: p_lis.append(n) return p_lis ans = set(f(A)) & set(f(B)) print(len(ans) + 1)
p03827
s604357136
Wrong Answer
n=int(input()) s=input() ans=0 ans1=0 for i in range(n): if s[i]=='I': ans+=1 ans1=max(0,ans) else: ans-=1 print(ans1)
p02608
s046958445
Accepted
nn=int(input()) nc = [0] * (nn + 1) for x in range(1, 100): for y in range(1, 100): for z in range(1, 100): a = x * x + y * y + z * z + x * y + x * z + y * z if a > nn: break nc[a] += 1 for i in range(1, nn + 1): print(nc[i])
p03416
s887557531
Wrong Answer
a,b = map(int, input().split()) c = 0 while a < b: if str(a)[::-1] == str(a): c += 1 a += 1 print(c)
p03324
s803000309
Accepted
d, n = map(int, input().split()) if n == 100: print(100**d*101) else: print(100**d*n)
p02683
s446628462
Accepted
import sys input = sys.stdin.readline from itertools import product N,M,X=(int(x) for x in input().rstrip('\n').split()) pat = [x for x in product([0,1], repeat=N)] OK = [] C={} for i in range(N): C[i]=[int(x) for x in input().rstrip('\n').split()] for i in pat: ans = [0]*(M+1) for x in range(N): add = [y*i[x] for y in C[x]] ans = [y + z for (y,z) in zip(add,ans)] if all(y>=X for y in ans[1:]): OK.append(ans[0]) if len(OK) >0: print(min(OK)) else: print('-1')
p03785
s332468504
Accepted
n, c, k = map(int, input().split()) times = [] for _ in range(n): t = int(input()) times.append((t, t+k)) times.sort(key=lambda x: x[1]) ans = 0 x = 0 capacity = 0 for L, R in times: if L <= x: if c == capacity: capacity = 1 ans += 1 x = R else: capacity += 1 else: x = R ans += 1 capacity = 1 print(ans)
p02629
s084873644
Wrong Answer
N = int(input()) rslt = "" sub = 1 while N >= 0: rslt = chr((N - 1) % 26 + ord('a')) + rslt sub *= 26 N -= sub + (N % 26 - 1) print(rslt)
p03711
s975375415
Wrong Answer
a,b=map(int,input().split()) n=[1,3,5,7,8,10,12] m=[4,6,9,11] o=[2] p=[n,m,o] if p.count(a)==p.count(b): print('Yes') else: print('No')
p04005
s090239268
Accepted
# coding: utf-8 # Your code here! A,B,C = map(int,input().split()) v = A*B*C if v%2 == 0: print(0) else: print(min(A*B,B*C,C*A))
p02771
s668176334
Accepted
str = input() ipt = list(map(lambda x: int(x), str.split())) ipt.sort() if ipt[0]==ipt[1] and ipt[1]==ipt[2]: print('No') elif ipt[0]==ipt[1] or ipt[1]==ipt[2]: print('Yes') else: print('No')
p02664
s837589686
Wrong Answer
T = input() T = T.replace("??", "PD"); T = list(T) for i in range(len(T)): if T[i] == "?": T[i] = 'D' if i+1 < len(T): if T[i+1] == 'D': T[i] = 'P' for i in T: print(i, end=""), print()
p02881
s186645104
Accepted
n = int(input()) l = [] for i in range(1,n): sur = n%i ans = n/i # print(i,ans,sur) if ans < i: break elif sur == 0: l.append(i) l.sort(reverse=True) max = l[0] max_op = n/max ite = max-1+max_op-1 print(int(ite))
p03632
s217213582
Accepted
A, B, C, D = map(int, input().split()) T = max(B, D) + 1 ans = 0 for i in range(T): if A <= i < B and C <= i < D: ans += 1 print(ans)
p02729
s378256465
Accepted
N,M=map(int, input().split()) if M == 1 or M==0: answer = N * (N-1)//2 elif N == 1 or N==0: answer = M * (M-1)//2 else: answer = (N * (N-1))//2 + (M * (M-1))//2 print(answer)
p02765
s763167151
Wrong Answer
N,R = map(int,input().split()) if N >= 10: print(R) else: print(R-100*(10-N))
p02725
s066513360
Wrong Answer
k, n = map(int, input().split()) a=[0]*n a=list(map(int, input().split())) for i in range(n): if a[i]>(k+0.5)//2: a[i]=int((k+0.5)//2)-a[i] la=sorted(a) print(max(a)-la[0])
p02911
s653595518
Wrong Answer
import sys input = sys.stdin.readline N, K, Q = map(int, input().split()) A = [int(input().rstrip()) for i in range(Q)] print(A) score =[0]*(N) for i in range(Q): score[A[i]-1] += 1 print(score) for i in range(N): if K+score[i]-Q >0: print('yes') else: print('No')
p02996
s395740695
Wrong Answer
N = int(input()) ls = [] now = 0 simekiri = 0 flag = 0 for i in range(N): a,b = map(int,input().split()) ls.append([b,a]) ls.sort() print(ls) for i in range(len(ls)): simekiri = ls[i][0] now += ls[i][1] if now > simekiri: print("No") flag += 1 break if flag == 0: print("Yes")
p02628
s428191752
Accepted
N, K = map(int, input().split()) p = list(map(int, input().split())) sum = 0 p.sort() for i in range(0, K): sum += p[i] print(str(sum))
p03062
s702866822
Accepted
n = int(input()) minus = 0 m = float("inf") s = 0 for i in map(int,input().split()): if i < 0: minus += 1 m = min(m,-i) s -= i else: m = min(m,i) s += i if minus % 2 == 0: print(s) else: print(s-2*m)
p03861
s767788989
Wrong Answer
import math a,b,x=map(int, input().split()) A=math.ceil(a/x) B=math.floor(b/x) print(B-A+1)
p02783
s914808713
Wrong Answer
H, A = map(int, input().split()) print(H // A + 1)
p02719
s940558762
Accepted
N,K=(int(x) for x in input().split()) x=N%K print(min([x,abs(K-x)]))
p02866
s090713167
Wrong Answer
from collections import Counter mod = 998244353 n = int(input()) dl = list(map(int, input().split())) c = Counter(dl) if dl[0]!=0: print(0) exit() for x in range(max(dl)+1): if c[x]==0: print(0) exit() res = 1 for x in range(max(dl)): res *= pow(c[x],c[x+1],mod) res %= mod print(res)
p03680
s897141872
Accepted
n = int(input()) a = [int(input()) for _ in range(n)] L = [0] * n cnt = 0 i = 0 while True: if L[i] == 1: print(-1) break else: L[i] = 1 i = a[i] - 1 cnt += 1 if i == 1: print(cnt) break
p03910
s688975441
Wrong Answer
n = int(input()) m = n // 2 +1 if n-m > 0: print(n-m) print(m)
p02646
s240863526
Accepted
A, V = map(int, input().split()) B, W = map(int, input().split()) T = int(input()) if V > W and abs(A - B) / (V - W) <= T: print("YES") else: print("NO")
p02693
s743854280
Wrong Answer
K = int(input()) A, B = map(int,input().split()) n = 1 m = 1 for i in range(1100): if A <= K * i: n = i for i in range(n, 1100): if B >= K * i: m = i - 1 if m - n >= 0: print("OK") else: print("NG")
p02963
s123713933
Accepted
s = int(input()) thld = pow(10,9) x = (thld-s%thld)%thld print(0, 0, thld, 1, x, (s+x)//thld)
p02987
s457258555
Accepted
from collections import Counter s=input() t=Counter(s) if len(t)==2 and max(t.values())==2: print("Yes") else: print("No")
p03456
s694272261
Wrong Answer
a,b = map(str, input().split()) c = int(a+b) flag = False for i in range(1000): if i**2 == c: flag = True exit(0) print("Yes") if flag else print("No")
p03001
s498694570
Accepted
w, h, x, y = map(int, input().split()) ans = (w*h)/2 num = 0 if w/2 == x and h/2 == y: num = 1 print(ans,num)
p03815
s208216211
Accepted
def main(): x = int(input()) cnt = x // 11 * 2 rem = x % 11 if rem > 6: cnt += 2 elif rem > 0: cnt += 1 print(cnt) if __name__ == '__main__': main()
p03251
s216413439
Accepted
import sys N, M, X, Y = map(int, input().split()) X_lis = list(input().split()) X_lis = [int(X_lis[i]) for i in range(N)] Y_lis = list(input().split()) Y_lis = [int(Y_lis[i]) for i in range(M)] for Z in range(X+1, Y+1): if Z > max(X_lis) and Z <= min(Y_lis): print('No War') sys.exit() print('War')
p03208
s861822265
Accepted
n, k = map(int, input().split( )) arr = [] for _ in range(n): arr.append(int(input())) a = sorted(arr) m = 10**9 for i in range(n-k+1): ma = a[i+k-1] - a[i] m = min(m, ma) print(m)
p03339
s091881887
Wrong Answer
n = int(input()) s = input() e = int(s.count('E')) w = n - e if e >= w: print(w) else: print(e)
p03493
s098574194
Accepted
l = input()#三文字まで counter = 0 for i in range(3): if l[i] == "1": counter += 1 print(counter)
p02833
s976477166
Wrong Answer
import sys IS = lambda: sys.stdin.readline().rstrip() II = lambda: int(IS()) MII = lambda: list(map(int, IS().split())) def main(): n = II() cnt = 0 val = 10 while True: if n <= val: break cnt += n//val val *= 5 print(cnt) if __name__ == '__main__': main()
p03469
s339052601
Accepted
y, m, d = map(str, input().split('/')) print('2018' + '/' + m + '/' + d)
p02659
s484042942
Accepted
import math from decimal import Decimal A,B=map(Decimal,input().split()) print(math.floor(A*B))
p02862
s246345141
Accepted
X,Y=map(int,input().split()) mod=10**9+7 if (X+Y)%3!=0: print(0) else: N=int((2*Y-X)/3) M=int((2*X-Y)/3) if N<0 or M<0: print(0) if N==0 or M==0: print(1) if N>0 and M>0: List=[0 for i in range(N+M)] List[0]=1 for i in range(N+M-1): List[i+1]=List[i]*(i+2)%mod print(List[N+M-1]*pow(List[N-1],mod-2,mod)*pow(List[M-1],mod-2,mod)%mod)
p02576
s485414694
Accepted
import math N, X, T = map(int, input().split()) print(math.ceil(N/X)*T)
p02615
s476782887
Accepted
N=int(input()) A=list(map(int,input().split())) A.sort(reverse=True) ans=0 half=N//2+N%2 for i in range(1,N): if i<half: ans+=A[i-1] elif i==N-1: ans+=A[half-1] else: ans+=A[i-half+1] print(ans)
p02603
s981247612
Accepted
N = int(input()) A = list(map(int,input().split())) m = 1000 s = 0 for i in range(N-1): if A[i]<A[i+1]: s = m//A[i] m += (A[i+1]-A[i])*s print(m)
p03645
s416652114
Accepted
import sys from collections import deque N, M = map(int, input().split()) G = [[] for _ in range(N)] for _ in range(M): a, b = map(int, input().split()) G[a - 1].append(b - 1) G[b - 1].append(a - 1) for g in G[0]: if N - 1 in G[g]: print('POSSIBLE') sys.exit() print('IMPOSSIBLE')
p02555
s849889966
Wrong Answer
import sys sys.setrecursionlimit(10 ** 8) input = sys.stdin.readline def main(): S = int(input()) MOD = 10 ** 9 + 7 if S <= 3: print(0) exit() dp = [1] * (S + 1) dp[0] = 0 dp[1] = 0 dp[2] = 0 for i in range(3, S + 1): for j in range(i - 3, 1, -1): dp[i] += dp[j] dp[i] %= MOD print(dp[S] % MOD) if __name__ == '__main__': main()
p03543
s721863906
Wrong Answer
s=input() print('YNeos'[(2<len(set(s))) or s[1]!=s[2]::2])
p03437
s633866956
Accepted
import math x, y = map(int, input().split()) if x%y == 0: print(-1) else: print(x)
p02645
s090771822
Accepted
S = str(input()) print(S[:3])
p02777
s110542853
Accepted
s, t = input().split() a, b = map(int, input().split()) u = input() balls = {} balls[s] = a balls[t] = b balls[u] = balls[u] - 1 print('{0} {1}'.format(balls[s], balls[t]))
p03329
s655072683
Accepted
from bisect import bisect_right n = int(input()) l = [1] i = 1 while 6 ** i <= 100000: l.append(6 ** i) i += 1 i = 1 while 9 ** i <= 100000: l.append(9 ** i) i += 1 l.sort() dp = [float('inf')] * (n+1) dp[0] = 0 for i in range(1, n+1): for v in l: if v > i: break dp[i] = min(dp[i], dp[i-v] + 1) print(dp[n])
p03109
s405333636
Accepted
print(['TBD','Heisei'][input()<='2019/04/30'])
p02664
s968886398
Wrong Answer
t = input() t1 = t.replace('?', 'D') t2 = t.replace('?', 'P') print(max(t1.count('D') + t1.count('PD'), t2.count('D') + t2.count('PD')))
p02598
s245040467
Accepted
from math import ceil n, k = [int(_) for _ in input().split()] a = [int(_) for _ in input().split()] # a.sort() l, r = 0, 10**9 while r-l > 1: m = (l+r)//2 c = 0 for i in range(n): if a[i] < m: continue c += a[i]//m-(a[i] % m == 0) # print(c, l, r, m) if c > k: l = m else: r = m print(r)
p03814
s722273233
Accepted
S = list(input()) s = 0 g = len(S) -1 while S[s] != "A": s += 1 while S[g] != "Z": g -= 1 print(g-s+1)
p03479
s311088511
Accepted
a, b = map(int, input().split()) cnt=0 while a <=b: cnt+=1 a = a*2 print(cnt)
p03417
s380345481
Accepted
import sys def input(): return sys.stdin.readline()[:-1] def mi(): return map(int, input().split()) def ii(): return int(input()) def main(): N, M = mi() if N == M == 1: print(1) elif N == 1 or M == 1: print(max(N, M)-2) else: print((N-2)*(M-2)) if __name__ == '__main__': main()
p02627
s292785197
Accepted
A = input() if A.isupper(): print("A") else: print("a")
p04029
s912774615
Accepted
n = int(input()) s = 0 for i in range(1, n+1): s += i print(s)
p02700
s857288481
Accepted
a,b,c,d=map(int,input().split()) while(a>0 and c>0): c-=b a-=d if c<=0: print("Yes") else: print("No")
p03861
s060457941
Wrong Answer
a,b,x = map(int,input().split()) tmp = 0 if x>b: print(0) elif x<a: if a%x==0 or b%x==0: tmp += 1 print((b-a)//x+tmp) else: if b-a>=x: if a%x==0 or b%x==0: tmp += 1 print((b-a)//x+tmp) else: if a%x+b%x==x: tmp += 1 print(tmp)