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:
from math import ceil
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
a, b, x = map(int, input().split())


def solve1():
    xa = ceil(a/x)
    xb = b//x
    return xb-xa+1


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


def solve2():
    return f(b)-(a-1)


print(solve2())

Submission status: Wrong Answer

Solution code:
from math import ceil
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
a, b, x = map(int, input().split())


xa = ceil(a/x)
xb = b//x
print(xb-xa+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
 
if b < x:
    print(0)
elif a <= x <= b:
    if a == 0:
        print((b//x) + 1)
    else:
        print(b//x)
else:
    if (a%x == b%x == 0) and (1 < x):
        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 b < x:
    print(0)
elif a <= x <= b:
    print(b//x)
else:
    if a%x == 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 b < x:
    print(0)
elif a <= x <= b:
    print(b//x)
else:
    print((b//x)-(a//x)+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,x=[int(i) for i in input().split()]
bx=b//x
ab=a//x if a>0 else -1
print(bx-ab)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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())
c=0
if a%2==0:
    c=1
print((b//x)-(a//x)+c)

Submission status: Wrong Answer

Solution code:
a, b, x = list(map(int, input().split()))
if a % x == 0:
    m = a // x
else:
    m = a // x

if b % x == 0:
    M = b // x
else:
    M = b // x

print((M-m)/x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
print(b//x-a//x+1 if a!=b and a/x==a//x else 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==a//x else b//x-a//x)

Submission status: Wrong Answer

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

print(b//c-a//c + 1 if b//c-a//c != 0 else 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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+1) if a/x==a//x else print(b//x-a//x) if a!=b else print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
abx = list(map(int, input().split()))
if abx[1]%abx[2]==0 and abx[0]%abx[2]==0:
    print(abx[1]//abx[2] - abx[0]//abx[2] + 1)
else:
    print(abx[1]//abx[2] - abx[0]//abx[2])

Submission status: Wrong Answer

Solution code:
abx = list(map(int, input().split()))
print(abx[1]//abx[2] - abx[0]//abx[2])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A,B,X = map(int,input().split())
mn = -(-A//X)
mx = B//X
if A == B :
    print(0)
else:
    print(mx - mn + 1)

Submission status: Wrong Answer

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

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

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())
key = 0
score = 0
if a==b:
    if 1%x!=0:
        print(0)
        exit(0)

if a==0:
    score+=1


while True:
    if a <= (key + 10**16) * x <= b:
        score += 10**16
        key += 10**16
    elif a <= (key + 10**10) * x <= b:
        score += 10**10
        key += 10**10
    elif a <= (key + 10**8) * x <= b:
        score += 10**8
        key += 10**8
    elif a <= (key + 10000) * x <= b:
        score += 10000
        key += 10000
    elif a <= (key + 1000) * x <= b:
        score += 1000
        key += 1000
    elif a <= (key + 1) * x <= b:
        score += 1
        key += 1
    elif (key + 1) * x > b:
        print(score)
        exit(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def execute(a, b, x):
    if a == b:
        return 0
    count = (b - a) // x
    if a == 0:
        count += 1
    if x % 2 == 0:
        count += 1
    return count


if __name__ == '__main__':
    a, b, x = map(int, input().split())
    print(execute(a, b, x))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,x = map(int, input().split())
T = []
for i in range(a,b+1):
	if i%x==0:
		T.append(i)
	else:
		quit
print(T)
print(len(T))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
if b !=a:
    print(b//c-a//c+1)
elif a%c == 0:print(1)
else:print(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())

count = b // x  - a // x
if a == 0:
  count += 1

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
temp = input().rstrip().split(" ")
a = int(temp[0])
b = int(temp[1])
x = int(temp[2])
c = 0
for i in range(a,b+1):
    #print(i)
    if i % x == 0:
        c += 1
    if i == 20000:
        break
if i == 20000:
  print(int(b) / x)
else:
  print(c)

Submission status: Wrong Answer

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

print(B-A+ a%x==0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# 

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

c=b-a
d=int(c/x)
#print(d,e,c)
if a%x==0 and b%x==0:
    print(d+1)
else:
    print(d)

Submission status: Wrong Answer

Solution code:
# 

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

c=b-a
d=int(c/1e15)
e=int(c-d*1e15)
print(d,e,c)
if a%x==0 and b%x==0:
    print(d+1)
else:
    print(d)

Submission status: Wrong Answer

Solution code:
# 

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

s=0
for i in range(int(b/x)+1):
    k=x*i
    if k>=a:
        s+=1

print(s)

Submission status: Wrong Answer

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

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-a//x)+1)

Submission status: Wrong Answer

Solution code:
a, b, x = [int(i) for i in input().split()]
divableA = int((a-1) / x)
divableB = int(b / x)
print(divableB - divableA)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split(" "))
ad = 0
bd = 0
if a < x:
  for i in range(x):
    if (a+i) % x == 0:
      ad = a + i
      break
else:
  for i in range(2, b):
    if x * i > b:
      print(0)
      exit(0)
    if x * i >= a:
      ad = x * i
      break
bd = int(b//x) * x
print(int((bd - ad) // x) + 1)

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split(" "))
ad = 0
bd = 0
if a < x:
  for i in range(x):
    if (a+i) % x == 0:
      ad = a + i
      break
else:
  for i in range(2, b):
    if x * i >= b:
      print(0)
      exit(0)
    if x * i >= a:
      ad = x * i
      break
for i in range(x):
  if (b-i) % x == 0:
    bd = b - i
    break
print(int((bd - ad) // x) + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
line = input().split(" ")
a = int(line[0])
b = int(line[1])
x = int(line[2])

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

Submission status: Wrong Answer

Solution code:
line = input().split(" ")
a = int(line[0])
b = int(line[1])
x = int(line[2])

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

Submission status: Wrong Answer

Solution code:
a,b,x = [int(i) for i in input().split()]
#print(b/x)
#print((a-1)/x)
print(int(b/x) - int((a-1)/x))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if b%x==0:
    cnt+=1

print(cnt)

Submission status: Wrong Answer

Solution code:
# input
import math

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


ans = (b // x) - math.ceil(a / x) + 1
print(ans)

Submission status: Wrong Answer

Solution code:
# input
import math

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

ans = 0

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

Submission status: Wrong Answer

Solution code:
# input
import math

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

ans = 0

if x > b:
    print(0)
else:
    ans = max((b // x) - math.ceil(a / x) + 1, 0)
    print(ans)

Submission status: Wrong Answer

Solution code:
# input
import math

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

ans = 0

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

Submission status: Wrong Answer

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

v1 = int(b / x) + 1
v2 = 0
if a > 0:
    v2 = int((a  - 1) / x) + 1

print(v1 - v2)

Submission status: Wrong Answer

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

n = int(b / x)
s = int((a - 1) / x)

print(n - s)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def fanc(n, x):
    if n == -1:
        f = 0
    else:
        f = n // (x + 1) # 切り捨て除算//を使うとint同士ならintで返してくれるから楽
    return f
print(fanc(b, x) - fanc(a - 1, x))

Submission status: Wrong Answer

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

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

print(fanc(b, x) - fanc(a - 1, x))

Submission status: Wrong Answer

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

ans = 0
if a == 0:
    ans = 1
ans += int((b - a) / x )
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)

Submission status: Wrong Answer

Solution code:
T=input().split(" ")
a=int(T[0])
b=int(T[1])
x=int(T[2])
if a==0:
    print(b//x)
else:
    print((b//x)-((a-1)//x))

Submission status: Wrong Answer

Solution code:
## ABC 048 b
a,b,x = (int(_) for _ in input().split())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

B = b // x
A = (a - 1) // x
print(B, A)

print(B - A)

Submission status: Wrong Answer

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

if a/x == int(a/x) and b/x == int(b/x):
    print(int(1 + b/x - a/x))

elif a/x == int(a/x) and b/x != int(b/x):
    print(int(int(b/x) - int(a/x) + 1))

elif a/x != int(a/x) and b/x == int(b/x):
    print(int(int(b/x) - int(a/x)))

elif a/x != int(a/x) and b/x != int(b/x):
    print(int(int(b/x) - int(a/x)))

else:
    print('skfj')

Submission status: Wrong Answer

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

if a/x == int(a/x) and b/x == int(b/x):
    print(int(1 + b/x - a/x))

elif a/x == int(a/x) and b/x != int(b/x):
    print(int(int(b/x) - int(a/x) + 1))

elif a/x != int(a/x) and b/x != int(b/x):
    print(int(int(b/x) - int(a/x)))

elif a/x != int(a/x) and b/x != int(b/x):
    print(int(int(b/x) - int(a/x)))

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split(" ")))
b = a[0] // a[2] + 1
c = a[1] // a[2] + 1
if c - b == 0:
    print(0)
else:
    print(c - b + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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




elif a % x == 0 and b % x == 0:
    print(ans+1)
else:
    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:
a, b, x = map(int, input().split())
ans = int((b-a)/x)
if a % x == 0 and b % x == 0:
    print(ans+1)
else:
    print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
if a%x == 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)//x)+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, x = map(int, input().split())
if a != 0:
    print(int(b / x) - int((a - 1) / x))
else:
    print(int(b / 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())
if (a == 0):
  c = 0
  d = (b//x)+1
else:
  c = (a//x)+1
  d = (b//x)+1
print(d-c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
if (a % x != 0 and b % x != 0):
  print((b-a)//x)
else:
  print(((b-a)//x) + 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 = map(int, input().split())

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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 x == 1:
    ans = b-a+1
else:
    if a < b:
        if a % x == 0 and b % x == 0:
            ans = (b-a)//x + 1
        elif a % x == 0 or b % x == 0:
            ans = (b-a+1)//x + 1
        else:
            ans = (b-a+1)//x
    else:
        if a % x:
            ans = 0
        else:
            ans = 1

print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,x=map(int,input().split())
if b==0:
    print(1)
elif a==0:
    print(b//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 +1)
else:
    print(b//x - a//x)

Submission status: Wrong Answer

Solution code:
#1
x,y,z = map(int, input(). split())
num = []
for i in range(x, y+1):
    if (i % z) == 0:
        num.append(i)
    else: continue
print(num)

Submission status: Wrong Answer

Solution code:
#1
cnt = 0
x,y,z = map(int, input().split())
for i in range(x,y) :
    if i% z == 0 :
        cnt += 1
print (cnt)

Submission status: Wrong Answer

Solution code:
#1 
x,y,z = map(int,input().split())
a = 0
if x%z == 0:
    a = a+1
if y%z == 0:
    a = a+1
print(a)

Submission status: Wrong Answer

Solution code:
#1

x,y,z = map(int, input().split())
s = 0
for i in range(y-x) :
    x = x + i
    if x%z == 0:
        s = s + 1
print(s)

Submission status: Wrong Answer

Solution code:
#1
x,y,z = map(int, input().split())
print(int(y/z)-int((x-1)/z))

Submission status: Wrong Answer

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