Problem:


Score : 200 points

Problem Statement

You are given nonnegative integers a and b (a ≤ b), and a positive integer x.
Among the integers between a and b, inclusive, how many are divisible by x?

Constraints

0 ≤ a ≤ b ≤ 10^{18}

1 ≤ x ≤ 10^{18}

Input

The input is given from Standard Input in the following format:

a b x

Output

Print the number of the integers between a and b, inclusive, that are divisible by x.

Sample Input 1

4 8 2

Sample Output 1

3

There are three integers between 4 and 8, inclusive, that are divisible by 2: 4, 6 and 8.

Sample Input 2

0 5 1

Sample Output 2

6

There are six integers between 0 and 5, inclusive, that are divisible by 1: 0, 1, 2, 3, 4 and 5.

Sample Input 3

9 9 2

Sample Output 3

0

There are no integer between 9 and 9, inclusive, that is divisible by 2.

Sample Input 4

1 1000000000000000000 3

Sample Output 4

333333333333333333

Watch out for integer overflows.



Sample input:
4 8 2


Sample output:
3

Submission status: Wrong Answer

Solution code:
A = list(map(int,input().split()))
a=A[0]
b=A[1]
x=A[2]
s = 0
n = 0
if (a%2 == 0)and(b%2 == 0):
  b = b 
  s = (b - a) // x
  print(int(s +1))
else:
  b = b + 1
  s = (b - a) // x
  print(int(s))

Submission status: Wrong Answer

Solution code:
A = list(map(int,input().split()))
a=A[0]
b=A[1]
x=A[2]
s = 0
n = 0
if (a%2 == 0)and(b%2 == 0):
  b = b + 1
  s = (b - a) // x
  print(int(s +1))
else:
  b = b + 1
  s = (b - a) // x
  print(int(s))

Submission status: Wrong Answer

Solution code:
A = list(map(int,input().split()))
a=A[0]
b=A[1]
x=A[2]
s = 0
n = 0
b = b + 1
s=(b-a)//x
print(s)

Submission status: Wrong Answer

Solution code:
A = list(map(int,input().split()))
a=A[0]
b=A[1]
x=A[2]
s = 0
n = 0
s=(b-a)//x
print(s)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
 
print(b//x-a//x)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int, input().split())
print((b-a)//x + 1)

Submission status: Wrong Answer

Solution code:
a,b,x=list(map(int,input().split()))
if a%x==0 or b%x==0:
  print(b//x-a//x+1)
else:
  print(b//x-a//x)

Submission status: Wrong Answer

Solution code:
a,b,x=list(map(int,input().split()))
print(b//x-a//x+1)

Submission status: Wrong Answer

Solution code:
a,b,x=list(map(int,input().split()))
print(b%x-a%x)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
t = (b - a)//x
print(t+1 if a%x == 0 else t)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())

num= range(a,b)

d =0

for c in num:
  if c%x == 0:
    d+=1
  else:
    pass

print(d)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())

num= range(a,b)

d =0

for c in num:
  if c%x == 0:
    d+=1
  else:
    continue

print(d)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
y = b//x
z = max((a-1),0)//x
print(y-z)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
if x <= b:
#b以下で小さくかつbに最も近いxの倍数 x*i
    i = b // x
#aより小さくかつaに最も近いxの倍数 x*j
    j = (a-1) // x
    print(i-j)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
s = 0
if x <= b:
    for i in range(b-a+1): #aからbの中で最初にxで割り切れる数を探す
        if a % x == 0:
            s = (b-a)// x + 1 #初めて割り切れた数からbまでの割り切れる数の個数
            break
        elif a % x != 0:
            a = a + 1
print(s)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

def f(n, x):
    if n < 0:   # a == 0 
        return 0
    elif n == 0:
        return 1
    elif n < x:
        return 0
    else:
        return n // x

count = f(b, x) - f(a-1, x)

print(count)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
if b != 0:
  b = int(b // x)
else:
  b = 0
if a !=0:
  a = int((a - 0.1) // x)
else:
  a = 0
print(b-a)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
b = int(b // x)
a = int((a - 0.1) // x)
print(b - a)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
print((((b // x) - int((a - 0.1) // x))))

Submission status: Wrong Answer

Solution code:
a,b,c=map(int, input().split())
ll=[]
i=0
if a==0:
  ll.append(0)
while i<b:
  i+=c
  if i>=a:
    ll.append(i)
  
print(len(ll))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
print(b//x-a//x)

Submission status: Wrong Answer

Solution code:
a,b,x=map(lambda x: int(x), input().split())
ans=(b-a)//x
ans+=1 if a%x==0 or b%x==0 else 0
print(ans)

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
a=0
for i in range(A,B+1):
    if i%2==0:
        a=a+1
    else:
        a=a
print(a)

Submission status: Wrong Answer

Solution code:
#B - Between a and b ...
a,b,x = map(int, input().split())

if a==b:
    print(0)
else:
    min_dev = 0
    for i in range(a,b+1):
        if i%x==0:
            min_dev = i
            break

    max_dev = 0
    for i in range(a,b+1)[::-1]:
        if i%x==0:
            max_dev = i
            break

    print((max_dev-min_dev)//x+1)

Submission status: Wrong Answer

Solution code:
a, b, x  = list(map(int, input().split()))
print(b//x - a//x + 1)

Submission status: Wrong Answer

Solution code:
def main():
    a, b, x = map(int, input().split())
    if a == b:
        ans = 0
    else:
        a_q, a_mod = divmod(a, x)
        b_q, b_mod = divmod(b, x)

        ans = b_q - a_q
        if a_mod == 0:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a,b,x = [int(i) for i in input().split()]

if (b-a)%x == 0:
    print(b//x - a//x)
else:
    print(b//x - a//x+1)

Submission status: Wrong Answer

Solution code:
from math import ceil
a, b, x = map(int, input().split())
c, d = x * ceil(a/x), x * (b//x+1)
print((d - c) // x)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
 
m1 = a//x
m2 = b//x

if m1 == (a/x):
    print(m2-m1+1)
else:
    print(m2-m1)

Submission status: Wrong Answer

Solution code:
import sys
a, b, x = map(int, input().split())

if a == b == 0:
    print(1)
    sys.exit()

if x > b:
    print(0)
    sys.exit()

if x <= b:
    if a % x == 0:
        print(b // x - a //x + 1)
    else:
        print(b // x - a // x)

Submission status: Wrong Answer

Solution code:
import sys
a, b, x = map(int, input().split())

if x > b:
    print(0)
    sys.exit()

if x <= b:
    if a % x == 0:
        print(b // x - a //x + 1)
    else:
        print(b // x - a // x)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

ans = (b - a) // x

if a % x == 0 or b % x == 0:
    ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

ans = (b - a) // x

if a % x == 0 or b:
    ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

ans = (b - a) // x

if a % x == 0 or b % x == 0:
    ans += 1

if a == 0:
    ans -= 1

print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

ans = (b - a) // x

if a % x == 0 or b % x == 0 or a != 0:
    ans += 1
    print(ans)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

ans = (b - a) // x

if a % x == 0 or b % x == 0:
    ans += 1
    print(ans)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

ans = (b - a) // x

if a % x == 0:
    ans += 1
    print(ans)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
from fractions import gcd
from datetime import date, timedelta
from heapq import*
import math
from collections import defaultdict, Counter, deque
import sys
from bisect import *
import itertools
import copy
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7


def main():
    a, b, x = map(int, input().split())
    if(b % x == 0):
        print(b // x - a // x + 1)
    else:
        print(b//x - a//x)
    

    

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a,b,x = map(int, input().strip().split(' '))
print((b//x) - (a//x))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
print((b // x) - (a // x) + 1 if a % 2 == 0 else (b // x) - (a // x))

Submission status: Wrong Answer

Solution code:



def main():

    a,b,x = map(int,input().split())

    if a-1 == -1: print(0);exit()
    
    print((b//x)-((a-1)//x))




if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:



def main():

    a,b,x = map(int,input().split())

    if a-1 == 0: print(0);exit()
    
    print((b//x)-(a-1)//x)




if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
A, B, X = map(int, input().split())
if A % X != 0:
    A += A - A % X
B -= B % X

if A > B:
    print(0)
else:
    ans = (B - A) // X + 1
    print(ans)

Submission status: Wrong Answer

Solution code:
A, B, X = map(int, input().split())
A += A % X
B -= B % X

if A > B:
    print(0)
else:
    ans = (B - A) // X + 1
    print(ans)

Submission status: Wrong Answer

Solution code:
A, B, X = map(int, input().split())

if A == 0:
    A += X

A += A % X

if B % X != 0:
    B -= X - B % X

if A > B:
    print(0)
else:
    ans = (B - A) // X + 1
    print(ans)

Submission status: Wrong Answer

Solution code:
A, B, X = map(int, input().split())
A += A % X

if B % X != 0:
    B -= X - B % X

if A > B:
    print(0)
else:
    ans = (B - A) // X + 1
    print(ans)

Submission status: Wrong Answer

Solution code:
A, B, X = map(int, input().split())
A += A % X
ans = (B - A) // X + 1
print(max(0, ans))

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    a, b, x = map(int, input().split())
    if x > b:
        print(0)
    elif x == 1:
        print(b + 1 - a)
    elif a == b:
        print(int(b % x == 0))
    else:
        z = (b) // x
        z -= (a - 1) // x
        print(z)

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    a, b, x = map(int, input().split())
    if x > b:
        print(0)
    elif x == 1:
        print(b + 1 - a)
    elif a == b:
        print(int(b % x == 0))
    else:
        z = (b + 1) // x
        z -= (a + 1) // x
        z += int(a % x == 0)
        print(max(0, z))

Submission status: Wrong Answer

Solution code:
import math
if __name__ == "__main__":
    a, b, x = map(int, input().split())
    if x > b:
        print(0)
    elif x == 1:
        print(b + 1 - a)
    elif a == b:
        print(int(b % x == 0))
    else:
        z = (b + 1) // x
        z -= a // x
        z += int(a % x == 0)
        print(max(0, z))

Submission status: Wrong Answer

Solution code:
import math
a,b,x = map(int,input().split())
def f(p):
  if p >= 0:
    return math.floor(p/x) + 1
  else:
    return 0
print(f(b)-f(a-1))

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
def f(p):
  if p >= 0:
    return int(p/x) + 1
  else:
    return 0
print(f(b)-f(a-1))

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
def f(p):
  if p > 0:
    return p/x + 1
  else:
    return 1
print(f(b)-f(a-1))

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
print((b//x)+(a-1)//x)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())

z = a
c = a%x 
a = a+c 

if(a>b):
    ans = 0
else:
    ans = b//x-z//x + 1
    
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())

c = a%x 
a = a+c 

if(a>b):
    ans = 0
else:
    ans = b//x-a//x + 1
    
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())

c = a%x 
a = a+c 

if(a>b):
    ans = 0
else:
    ans = (b-a)//x + 1
    
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

if a % x == 0 and b % x == 0:
    ans = (b // x) - (a // x) + 1
else:
    ans = (b // x) - (a // x)


print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

if a%2 != 0:
    print(int(b/x) - int(a/x) )
else:
    print(int(b/x) - int(a/x) + 1)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
print(int(b/x) - int(a/x))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
print(int(b/2) - int(a/2))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
ans = (b - a) // x
if a % x == 0 and b % x == 0:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
ans = (b-a)//x
if a % x == 0 and b % x == 0 :
  print(ans+1)
else:
  print(ans)

Submission status: Wrong Answer

Solution code:
#-*- coding:utf-8 -*-
a,b,x=map(int,input().split())

count=0
if x==1:
  count=b-a+1
elif x<=b and a!=b:
  num=x
  while num<a:
    num+=x
  count+=1
  while num<b:
    num+=x
    count+=1
elif a==b and a%x==0:
    count+=1
print(count)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())

count=0
if a!=b:
  for i in range(a,b+1):
    if i%x==0:
      count+=1
  print(count)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
ans = 0
if a % x == 0:
    print((b-a)//x+1)
else:
    print((b-a)//x)

Submission status: Wrong Answer

Solution code:
def ceil(a):
  if a == int(a):
    return int(a)
  else:
    return int(a) + 1

a, b, x = map(int, input().split())

left = ceil(a/x)
right = b//x + 1

print(right - left)

Submission status: Wrong Answer

Solution code:
def ceil(a):
  if a == int(a):
    return int(a)
  else:
    return int(a) + 1

a, b, x = map(int, input().split())

first = ceil(a/x)
last = b//x

print(last - first + 1)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
print((b - a) // x + int(a % x == 0 or b % x == 0))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
ans = (b - a + 1) // x
if b % x == 0 and a % x == 0 and a != 0:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
ans = (b - a + 1) // x
if b % x == 0 and a % x == 0 and x != 1:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int,input().split())
print((b//x) - (a//x))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split(" "))
if a == 0:
  print((b // x) - (a // x) + 1)
else:
  print((b // x) - (a // x))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split(" "))
if a == 0:
  print((b // x) - (a // x) + 1)
else:
  print((b // x) - (a // x) + 1)

Submission status: Wrong Answer

Solution code:
s=input().split()
 
b = s[1]
 
S='A'+b[0]+'C'
 
print(S)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
xx = a%x
print(int(((b-a)-xx)/x+1))

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())

ans = (b-a)//x
if a % x == 0:
  ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int, input().split())
count = 0
for value in range(a, b+1):
  if value % x == 0:
    count +- 1
print(count)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
print(b//x - (a-1//x))

Submission status: Wrong Answer

Solution code:
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
 
a,b,x = na()

while True:
  if a % x == 0:
    break
  if a == b:
    break
  a += 1

if a == b:
  print(0)
else:
  print((b-a)//x+1)

Submission status: Wrong Answer

Solution code:
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
 
a,b,x = na()

while True:
  if a % x == 0:
    break
  if a == b:
    break
  a += 1

print((b-a)//x+1)

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        a, b, x = map(int, input().split())
        fa = (a - 1) // (x + 1) if a - 1 >=0 else 0
        fb = b // (x + 1) if b >= 0 else 0
        print(fb - fa)


# Run main
if __name__ == '__main__':
    AtCoder().main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        a, b, x = map(int, input().split())
        fa = (a - 1) // (x + 1) if a - 1 > 0 else 0
        fb = b // (x + 1) if b > 0 else 0
        print(fb - fa)


# Run main
if __name__ == '__main__':
    AtCoder().main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        a, b, x = map(int, input().split())
        fa = (a - 1) // (x + 1) if a > 0 else 0
        fb = b // (x + 1) if b > 0 else 0
        print(fb - fa)


# Run main
if __name__ == '__main__':
    AtCoder().main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        a, b, x = map(int, input().split())
        fa = a // (x + 1) if a > 0 else 0
        fb = b // (x + 1) if b > 0 else 0
        print(fb - fa)


# Run main
if __name__ == '__main__':
    AtCoder().main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        a, b, x = map(int, input().split())
        if b % x == 0:
            print(1 + (b - a) // x)
        elif b ==a:
            print(0)
        else:
            print((b - a) // x)


# Run main
if __name__ == '__main__':
    AtCoder().main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        a, b, x = map(int, input().split())
        if b % x == 0:
            print(1 + (b - a) // x)
        else:
            print((b - a) // x)


# Run main
if __name__ == '__main__':
    AtCoder().main()

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
F = (a // x) * x
if a % x != 0:
    F += x
print(F)
if F > b:
    print(0)
else:
    print((b - F) // x + 1)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
F = 0
for i in range(b-a+1):
    if (i+a)%x==0:
        F = i+a
        break
# print(F)
print((b-F)//x+1)

Submission status: Wrong Answer

Solution code:
import math

a, b, x = map(int, input().split())
minNum = math.ceil(a / x) * x
print(int(b - minNum + x - ((b - minNum + x) % x))//x if minNum <= b else 0)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int,input().split())
print(b//x-a//x)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int,input().split())
print((b-a)//x)

Submission status: Wrong Answer

Solution code:
a,b,x= map(int,input().split())
result=0
num = a
for _ in range(a,b+1,x):
    if num <= b and num % x == 0 :
        # print("num",num)
        result+=1
    num+=x
# while a <= b:
#     if a % x == 0:
#         result+=1
#     a+=x
print(result)

Submission status: Wrong Answer

Solution code:
a,b,x= map(int,input().split())
result=0
while a <= b:
    if a % x == 0:
        result+=1
    a+=x
print(result)

Submission status: Wrong Answer

Solution code:
import math

a, b, x = map(int, input().split())
minNum = math.ceil(a / x) * x
print(math.floor((b - minNum)/x) + 1 if minNum <= b else 0)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
def f(n):
    if n == 0:
        return -1
    else:
        return n // x
ans = f(b) - f(a)
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

if a % x == 0 and b % x == 0:
    print(b // x - a // x + 1)
else:
    print(b // x - a // x)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

# print(a)
# print(b)
# print(x)

# count = 0
# for i in range(a, b + 1):
#     # print(i)
    
#     if i % x == 0:
#         count += 1
        
# print(count)

def f(n):
    if n == -1:
        return 0
    else:
        return int(n / x) + 1

# print(int((a -1) / x) + 1)
# print(int(b / x))

print(f(b) - f(a - 1))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

# print(a)
# print(b)
# print(x)

# count = 0
# for i in range(a, b + 1):
#     # print(i)
    
#     if i % x == 0:
#         count += 1
        
# print(count)

# print(int((a -1) / x))
# print(int(b / x))

print(int(b / x) - int((a -1) / x))

Submission status: Wrong Answer

Solution code:
import math

a, b, c = list(map(int, input().split(" ")))
f1 = 0
f2 = 0
if a % c == 0:
    bottom = a//c
    f1 = 1
else:
    bottom = a//c + 1

if b % c == 0:
    top = b//c
    f2 = 1
else:
    top= b//c + 1
print( top - bottom + f1*f2)

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split(' ')))

if a == 0:
    min_ = 0
else:
    min_ = (a - 1) // x + 1
if b == 0:
    max_ = 0
else:
    max_ = b // x + 1
#print(min_, max_)
print(max_ - min_)

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split(' ')))

if a == 0:
    min_ = 0
else:
    min_ = a // x + 1
if b == 0:
    max_ = 0
else:
    max_ = b // x + 1
#print(min_, max_)
print(max_ - min_)

Submission status: Wrong Answer

Solution code:
import math

a, b, x = list(map(int, input().split(' ')))

if a == 0:
    min_ = 0
else:
    min_ = math.ceil((a - 1) / x)
    if (a - 1) % x == 0:
        min_ += 1
if b == 0:
    max_ = 0
else:
    max_ = math.ceil(b / x)
    if b % x == 0:
        max_ += 1
#print(min_, max_)
print(max_ - min_)

Submission status: Wrong Answer

Solution code:
import math

a, b, x = list(map(int, input().split(' ')))

min_ = math.floor(a / x) + 1
if a == 0:
    min_ -= 1
max_ = math.floor(b / x) + 1
if b == 0:
    max_ -= 1
print(max_ - min_)

Submission status: Wrong Answer

Solution code:
import math

a, b, x = list(map(int, input().split(' ')))

min_ = math.ceil((a - 1) / x) + 1
max_ = math.floor(b / x) + 1
print(max_ - min_)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
if a == 0:
    print((b-a)// x + 1)
else:
    print((b-a)// x)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
print((b-a+1)// x)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
print(b//x - (a-1)//x) if a != b and b//x != 0 else print(0)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
print(b//x - (a-1)//x + 1) if a != b and b//x != 0 else print(0)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
print(b//x - a//x + 1) if a != b and b//x != 0 else print(0)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
print(b//x - a//x + 1)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
print(b//x-a//x+(b%x == 0 and a%x == 0)*1)

Submission status: Wrong Answer

Solution code:
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

a, b, x = ISI()
ans = (b-a)//x
if b%x == 0:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

ans = (b - a) // x
if not b == 0 and b % x == 0:
  ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
from decimal import *
a,b,x = map(int,input().split())
print((Decimal(b//x)-Decimal((a-1)/x)))

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
print(b//x-a//x)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())


rep = (b-a)//x
m = (b-a)%x

ans = 0

if a % x == 0:
    ans += 1
    
if m == 0:
    print(ans+rep)
else:
    if (a+m)%x == 0:
        print(ans+rep+1)
    else:
        print(ans + rep)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())


rep = (b-a)//x

if (b-a)%x == 0:
    if a%x == 0:
        print(rep+1)
    else:
        print(rep)
else:
    m = (b-a)%x
    if (a + m)%x == 0:
        print(rep+1)
    else:
        print(rep)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
print(1 + (b-a) // x if a % x == 0 else (b-a) // x)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
print(int(b//x - a//x))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
k = (b - ((a//x) * x)) // x
print(k + 1 if b % x == 0 else k)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
result = 0
if b % x == 0:
    result += 1
result += (b - a) // x
print(result)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
result = 0
if a % x == 0:
    result += 1
result += (b - a) // x
print(result)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int, input().split())
r = 0

r = (b-a+1)//x

if x != 1:
    if a%x ==0 or b%x ==0:
        r = r+1


print(r)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int, input().split())
r = 0

r = (b-a+1)//x

print(r)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int, input().split())
r = 0

r = (b-a)//x
if a % x ==0 or b % x ==0:
    r = r +1


print(r)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int, input().split())
r = 0

r = (b-a)//x
if a % x ==0:
    r = r +1


print(r)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
ax = a // x
bx = b // x
if a % x == 0 or b % x == 0:
    print(bx - ax + 1)
else:
    print(bx - ax)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
ax = a // x
bx = b // x
if a % x == 0 and b % x == 0:
    print(bx - ax + 1)
else:
    print(bx - ax)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
ax = a // x
bx = b // x
if b % x == 0:
    print(bx - ax + 1)
else:
    print(bx - ax)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
print(-(a-1)//x+b//x)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
print(int(b/x)-int((a-1)/x) if a != 0 else int(b/x)+1)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
print(int(b/x)-int((a-1)/x))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
a, b, x = map(int, input().split())

count_b = b // x + 1
if a == 0:
    count_a = 0
else:
    count_a = a // x + 1

print(count_b - count_a)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
a, b, x = map(int, input().split())

count = b//x - a//x
print(count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
a, b, x = map(int, input().split())

count = 0
if a % x == 0:
    count += 1

count += (b-a)//x

print(count)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
if a % x == 0 or b % x == 0:
    print(b // x - a // x + 1)
else:
    print(b // x - a // x)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
if a % x == 0 and b % x == 0:
    print(b // x - a // x + 1)
else:
    print(b // x - a // x)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
print((b//x) - (a//x) + 1 if a//x == 0 else 0)

Submission status: Wrong Answer

Solution code:
a , b , x = map(int , input().split())
if a == b:
    print(0)
else:
    print(int((b/x) -int(a/ x) + 1))

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split()))
ans = (b - a) // x
if(a % x == 0): 
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split()))
ans = (b - a) // x
if(a % x == 0 or b % x == 0): 
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split()))
ans = int((b - a) // x)
if(a % x == 0 or b % x == 0): 
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,x=input().split()
a,b,x=int(a),int(b),int(x)

if a%x==0:
    k=a//x
else:
    k=a//x

l=b//x

print(l-k+1)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
if a%x==0 or b%x==0:
    print(b//x-a//x+1)
else:
    print(b//x-a//x)

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split()))
b_ans = b/x
amin_ans = (a-1)/x
ans = b_ans-amin_ans
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split()))
b_ans = int(b/x)
amin_ans = int((a-1)/x)
ans = b_ans-amin_ans
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split()))
b_ans = int(b/x)
amin_ans = int((a-1)/x)
ans = b_ans-amin_ans

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split()))
ans = 0
a %= x
b %= x
for i in range(a, b+1):
    if i % x == 0:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
print((b+1)//x-a//x)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
count=0

div=a//x
md=a % x

mn=a+(x-md)

count=(b-mn+1)//x
amari=(b-mn+1) % x

if amari==0 :
  print(count)
else :
  print(count+1)

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
print((b+1-a)//x)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
if a%2 == 0 and (x%2 == 0 or x == 1):
  print(b//x-a//x+1)
else:
  print(b//x-a//x)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int, input().split())
print(int((b/x) - (a-1)/x))

Submission status: Wrong Answer

Solution code:
a,b,x = map(int, input().split())
print(int(b/x) - int((a-1)/x))

Submission status: Wrong Answer

Solution code:
a,b,x = map(int, input().split())

print(int(b/x - (a-1)/x))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
print(int((b-a+1)//x))

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
a_x = a // x
b_x = b // x
if a != b:
    print(b_x - a_x + 1)
else:
    if a % x == 0:
        print(1)
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
a , b , x = map(int,input().split())
cnt = 0
a = (a - 1 ) // x
b /= x
print(b - a)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
if a == 0 and b == 0:
    print(0)
    exit()
c = (b - a) // x
if a % x == 0 or b % x == 0:
    c += 1
print(c)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
c = (b - a) // x
if (a != 0 or b != 0) and (a % x == 0 or b % x == 0):
    c += 1
print(c)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
c = (b - a) // x
if a % x == 0 or b % x == 0:
    c += 1
print(c)

Submission status: Wrong Answer

Solution code:
A,B,X = map(int,input().split(' '))
print((B-A+1) // X)

Submission status: Wrong Answer

Solution code:
A,B,X = map(int,input().split(' '))
print((B-A) // X)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())

print( b//x - a//x + 1)

Submission status: Wrong Answer

Solution code:
import sys
import copy

fline = input().rstrip().split(' ')
a, b, x = int(fline[0]), int(fline[1]), int(fline[2])

c = b-a
y = c//x +1
print(y)