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.

Solution (Python):
_input = list(map(int, input().split(" ")))
a = _input[0]
b = _input[1]
x = _input[2]

result = b // x - (a - 1)// x

print(result)

Solution (Python):
import math  
import bisect  
import queue  





















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


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

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

Solution (Python):
import math  
import bisect  
import queue  


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

    L = b - a + 1
    res = L // x
    if L % x != 0:
        if a % x == 0 or b % x == 0:
            res += 1
        else:
            c = b - b % x
            if a <= c:
                L = c - a + 1
                res = L // x
                if L % x != 0:
                    if a % x == 0 or c % x == 0:
                        res += 1
    print(res)

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

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

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

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

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

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

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

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

print(b-a)

Solution (Python):
def solve(a, b, x):
    def f(n):
        if n == -1:
            return 0
        return n // x + 1
    
    print(f(b) - f(a - 1))



T = list(map(int, input().split()))
solve(T[0], T[1], T[2])

Solution (Python):






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

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

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

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

Solution (Python):
import math
a, b, x = map(int,input().split())
def fnc(n,x):
    if n == -1:
        return 0
    return n//x+1
print(fnc(b,x) - fnc((a-1),x))

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

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

Solution (Python):
def count(n, x):
  if n == -1:
    return 0
  return n//x+1

a, b, x = map(int, input().split())
print(count(b, x)-count(a-1, x))

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

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

m = (a-1) // x
n = b // x

print(n - m)

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

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    a, b, x = map(int, rl().split())
    ans = b // x - a // x
    if a % x == 0:
        ans += 1
    print(ans)


if __name__ == '__main__':
    solve()

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

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

n = b // x
m = (a-1) // x

print(n-m)

Solution (Python):
a, b, x = map(int, input().split())
m1 = a % x
m2 = b % x
if a == b:
  if a % x == 0:
    print(1)
  else:
    print(0)
  exit()
if m1 != 0:
  a = (a//x)*x + x
if m2 != 0:
  b = (b//x)*x

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

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

cnt_a = (a-1) // x
cnt_b = b // x

print(cnt_b-cnt_a)

Solution (Python):
nim, mike, kite = map(int, input().split())
print((mike // kite) - ((nim - 1) // kite))

Solution (Python):
a,b,x = map(int,input().split())
l,r = 0,0
if a%x == 0:
    l = a//x
else:
    l = a//x + 1
r = b//x

print(r-l + 1)

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

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

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

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    a,b,x=MI()
    print(b//x-(a-1)//x)

main()

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

if a == b and a % x != 0:
  result = 0
  print(result)
  exit()
elif a == b and a % x == 0:
  result = 1
  print(result)
  exit()
else:
  B = divmod(b, x)
  A = divmod(a, x)
  result = B[0] - A[0]
  if A[1] == 0: result += 1
  print(result)

Solution (Python):

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

r = b // x
l = a // x

if a % x == 0:
    print(r-l+1)
else:
    print(r-l)

Solution (Python):


def f(n, d):
    if n == -1:
        return 0
    return n // d + 1


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

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

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

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

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

Solution (Python):
a, b, x = map(int, input().split())
def solve(a,b,x):
  ans =  b//x - (a-1)//x
  
  return ans
print(solve(a,b,x))

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

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

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

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

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

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

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

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

Solution (Python):
import math

def main():
    a, b, x = map(int, input().split())
    n_b = b//x + 1

    if a - 1 >= 0:
         n_a = (a - 1)//x + 1
    else:
        n_a = 0

    ans = n_b - n_a

    print(ans)

main()

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

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

if a % x == 0:
    m = a // x
else:
    m = a // x + 1

if b < m*x:
    ans = 0
else:
    ans = (b - m*x) // x + 1

print(ans)

Solution (Python):
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time


def I(): return int(input())


def S(): return input()


def MI(): return map(int, input().split())


def MS(): return map(str, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


def print_matrix(mat):
    for i in range(len(mat)):
        print(*mat[i])


yn = {False: 'No', True: 'Yes'}
YN = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']

show_flg = False



def main():
    a, b, x = MI()
    n = b // x
    m = (a-1) // x
    print(n - m)


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby
    
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

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

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

if __name__ == '__main__':
    main()

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

if __name__ == '__main__':
    solve()

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

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

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

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

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

Solution (Python):
a,b,k = map(int,input().split())
temp =(a - 1 )//k
if a == 0:
  temp = -1
print(b//k - temp)

Solution (Python):

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

down = a//x
if down*x == a:
  down -= 1

up = b//x

print(up - down)

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

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

Solution (Python):
import sys

input = sys.stdin.readline


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


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

    ans = f(b, x) - f(a - 1, x)
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
import sys

input = sys.stdin.readline


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

    q, r = divmod(a, x)
    A = x * q + x * (r != 0)
    q, r = divmod(b, x)
    B = x * q

    if B < A:
        print(0)
    else:
        print((B - A) // x + 1)


if __name__ == "__main__":
    main()

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

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

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

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

Solution (Python):
a,b,n=map(int,input().split())

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

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



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

Solution (Python):
a, b, x = map(int, input().split())
start=a
if (a%x!=0):
    start=a+x-a%x
print(len(range(start, b+1, x)))

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

Solution (Python):
a, b, x = map(int, input().split())
cnt = 0

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

cnt = int(f(b) - f(a-1))

print(cnt)

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

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

Solution (Python):
x = [int(e) for e in input().split()]
a = x[0]
b = x[1]
c = x[2]
ans = 0
ans = (b//c) - (a-1)//c 
print(ans)

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

Solution (Python):
a, b, c = map(int, input().split())
d = b // c
if a == 0:
    print(d+1)
else:
    e = (a-1)//c
    print(d-e)

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

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

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

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

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

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

Solution (Python):

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

Solution (Python):

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

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

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

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

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

def f(n,x):
    return n//x+1

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

Solution (Python):
import math
a,b,x = map(int,input().split())
c = 0

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

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

Solution (Python):

import math
import itertools
import statistics

import collections


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

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

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

idx1 = 0
while x * idx1 < a:
    idx1 += 1

a = x * idx1

print(((b - (x * idx1)) // x) + 1)

Solution (Python):
a,b,x = map(int, input().split())
b_ = b // x
a_ = a // x
a_a = a % x

if a_a == 0:
    print(b_ - a_ + 1)
else:
    print(b_ - a_)

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

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

Solution (Python):
a,s,d=map(int,input().split())
l=1+ (a-1)//d if a>=1 else 0 
u=s//d+1
print(u-l)

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

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

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

def f(n):
    return n//x+1

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

Solution (Python):
a, b, x = [int(x) for x in input().split()]
if a % x == 0:
    print(b // x - a // x + 1)
else:
    print(b // x - a // x)

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

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

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

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

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

Solution (Python):




"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""






def main():
  a,b,x = map(int,input().split())
  print(b//x - (a-1)//x)
if __name__ == '__main__':
  main()

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

a, b, x = map(int, readline().split())
ans = b // x - (a - 1) // x
print(ans)

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

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

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

Solution (Python):
a, b, x = map(int, input().split())
p = (a + x - 1) // x
q = b // x
ans = q - p + 1
print(ans)

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


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

Solution (Python):
import sys

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

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

print("{}".format(cnt))

Solution (Python):
from sys import stdin
input = stdin.readline

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

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

Solution (Python):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    x = [int(i) for i in input().split()]
    a = (x[0]-1) // x[2]
    b = x[1] // x[2]

    print(b-a)

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

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

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

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

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

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

Solution (Python):
x = list(map(int,input().split()))
a = 0
if x[0]%x[2]==0:
    b = x[0]
else:
     b = ((x[0] // x[2])+1)*x[2]
c = (x[1]-b)//x[2] + 1

print(c)

Solution (Python):

import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [input() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [int(input()) for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def main():
    
    a, b, x = Scanner.map_int()

    def func(n, x):
        if n == -1:
            return 0
        else:
            return n // x + 1
    print(func(b, x) - func(a - 1, x))


if __name__ == "__main__":
    main()

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

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

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

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

Solution (Python):
p=0;q=0;r=0
a,b,x=map(int,input().split())
p=int(b//x+1)
q=int((a-1)//x+1)
r=int(p-q)
print(int(r))

Solution (Python):
p=0;q=0;r=0
a,b,x=map(int,input().split())
p=int(b//x+1)
q=int((a-1)//x+1)
r=int(p-q)
print(int(r))

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

Solution (Python):
a, b, x = map(int, input().split())
fa = max(a - 1, 0) // x
fb = b // x
ans = fb - fa if a != 0 else fb - fa + 1
print(ans)

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

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

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

a1 = -(-a//x) * x
b1 = b//x * x

print((b1-a1)//x+1)

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

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



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

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

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

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

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

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

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

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

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

if a%x==0:
    ax = a//x-1
else:
    ax = a//x

bx = b//x

print(bx-ax)

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

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

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

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

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


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

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

Solution (Python):
A,B,X=map(int,input().split())
C=A//X
D=B//X
if A%X==0:
	print(D-C+1)
else:
	print(D-C)

Solution (Python):
A,B,X=map(int,input().split())
C=A//X
D=B//X
if A%X==0 and B%X==0:
	print(D-C+1)
elif A%X!=0 and B%X==0:
	print(D-C)
elif A%X==0 and B%X!=0:
	print(D-C+1)
else:
	print(D-C)

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

min_ = a//x + (1 if a%x!=0 else 0)
max_ = b//x

print(max_-min_+1)

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


tmp1 = a // x
if a % x != 0:
    tmp1 = tmp1 + 1

tmp2 = b // x

print(tmp2 - tmp1 + 1)

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter,mul
from fractions import gcd
from functools import reduce
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]





def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

a,b,x=mii()


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

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

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

Solution (Python):
def main(a, b, x):
    if x > b:
        return 0
    elif x == b:
        return 1

    minimum, maximum = None, None

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

    for i in range(b, a - 1, -1):
        if i % x == 0:
            maximum = i
            break

    if minimum != None or maximum != None:
        if minimum != None and maximum != None:
            
            return (maximum - minimum) // x + 1
        else:
            return 1
    else:
        return 0


def main_b(a, b, x):
    """解説を読んだ。単純なことだった。
    """
    def count(n):
        if n == -1:
            return 0
        else:
            return n // x + 1

    return count(b) - count(a-1)


if __name__ == "__main__":
    a, b, x = [int(x) for x in input().split()]
    print(main_b(a, b, x))

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

Solution (Python):


import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

a, b, x = na()

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

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







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

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

cnt = 0
print(b // x - (a - 1) // x)

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

cnt=0

R=b//x
L=(a-1)//x

print(R-L)

Solution (Python):
def f(n, x):
    ans = 0
    if (0 <= n):
        ans = n // x + 1
    return ans


if __name__ == "__main__":
    a, b, x = map(int, input().split())
    print(f(b, x) - f(a - 1, x))

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

Solution (Python):

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

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

Solution (Python):

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

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

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

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

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

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

a_cnt=a//x
b_cnt=b//x

print(b_cnt-a_cnt+1 if a%x==0 else b_cnt-a_cnt)

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

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

Solution (Python):
a, b, x = map(int, input().split())
aa = (a-1) // x
bb = b // x
ans = bb-max(aa, 0)
if a == 0:
    ans += 1
print(ans)

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

a1 = (a // x) * x
b1 = (b // x) * x

ans = (b1 - a1) // x
if a1 == a:
    ans = ans + 1

print(ans)

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

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

Solution (Python):
a, b, x = map(int, input().split())
upper = b // x
lower = (a-1)//x

ans = upper - lower

print(ans)

Solution (Python):
import numpy as np
a, b, x = map(int, input().split())
upper = b // x
lower = (a-1)//x

ans = upper - lower

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    a,b,x=MI()
    ans=b//x-(a-1)//x
    print(ans)

main()

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

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

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

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

a_ = a//x
b_ = b//x

if a%x == 0:
    print(b_ - a_ + 1)
else:
    print(b_- a_)

Solution (Python):

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

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

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

end = 0
if b % c == 0:
    end = b//c
else:
    end = b//c

begin =  0
if a % c == 0:
    begin = a//c - 1
else:
    begin = a//c
print(end - begin)

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

a_=(a-1)//x
b_=b//x
print(b_-a_)

Solution (Python):








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

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


resolve()

Solution (Python):

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

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

Solution (Python):

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

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

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

Solution (Python):
from decimal import *




s = input().split()
t = [int(p) for p in s]


a = t[0]
b = t[1]
x = t[2]

'''
start = a
goal = b
while True:
    if(start % x == 0):
        break
    else:
        start += 1

while True:
    if(goal % x == 0):
        break
    else:
        goal -= 1




print(Decimal(Decimal(Decimal(goal) - Decimal(start)) / Decimal(x)) + Decimal(1)  ) 


'''

def count_even(t, x):
    return int( Decimal(t)/ Decimal(x) )

if( a == 0):
    answer = count_even(b, x) + 1
else:
    answer = count_even(b, x) - count_even(a-1, x)
print(answer)

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

n = b//x
m = (a-1)//x

ans = n-m

print("{}".format(ans))

Solution (Python):
import sys
readline = sys.stdin.buffer.readline

a,b,x = map(int,readline().split())
import math
low = (a+x-1)//x
high = b//x

print(high-low+1)

Solution (Python):
a, b, x = map(int, input().split())
def count(a, b, x):
  m = b // x + 1
  n = 0
  if a > 0:
    n = (a - 1) // x + 1
    
  return m - n
  
print(count(a, b, x))

Solution (Python):
import sys
from collections import Counter
def input():
    return sys.stdin.readline()[:-1]


def main():

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

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


if __name__ == "__main__":
    main()

Solution (Python):
import sys
input = sys.stdin.readline

a, b, x = map(int, input().split(' '))
m = b//x+1
n = 0
if a > 0:
    n = (a-1)//x+1
ans = m - n
print(ans)

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

Solution (Python):
def resolve():
    a, b, x = map(int, input().split())
    print(calc(b, x) - calc(a-1, x))
def calc(num, x):
    return num // x

if __name__ == '__main__':
    resolve()

Solution (Python):
A,B,X=map(int,input().split())
a=A%X
b=B%X
if a!=0:
    A=A+X-a
if b!=0:
    B=B-b
print((B-A)//X+1)

Solution (Python):
x,y,z=list(map(int, input().split()))
ans=0

if (y-x)//z==0:
	if x%z > y%z:
		ans=ans+1
	if x%z==0 or y%z==0:
		print(1)
	else:
		print(ans)
else:
	ans=((y//z)-((x-1)//z))
	if x==0:
		ans=ans
	print(ans)