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: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
"""
s = LS()[1]
print("A"+s[0]+"C")
"""
#B
a,b,x = LI()
print(b//x-(a-1)//x)
#C
"""
n,x = LI()
a = LI()
ans = 0
for i in range(n-1):
    if a[i]+a[i+1] > x:
        ans += a[i+1]+a[i]-x
        if x > a[i]:
            a[i+1] = x-a[i]
        else:
            a[i+1] = 0
            a[i] = x
print(ans)
"""

#D
"""
s = S()
l = len(s)
k = (s[0] == s[-1])
if (l%2)^k:
    print("First")
else:
    print("Second")
"""
#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Accepted

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

Submission status: Accepted

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

bn = b//x+1
an = (a-1)//x+1 if a > 0 else 0
print(bn - an)

Submission status: Accepted

Solution code:
def func(n):
    if n >= 0:
        return n // x + 1
    else:
        return 0

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

print(func(b)-func(a-1))

Submission status: Accepted

Solution code:
def count_multiple(n, x):
    return n // x


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

Submission status: Accepted

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

if a % x != 0:
    A = (a // x + 1)
else:
    A = a // x

B = b // x

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

Submission status: Accepted

Solution code:
a,b,x = [int(i) for i in input().split(" ")]
answer = 0
if (b-a)<x:
    answer+=(a%x==0)or(b%x==0)
elif a==0:
    answer+=b//x+1
else:
    answer+=b//x-a//x+(a%x==0)

print(int(answer))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
a, b, x = [int(x) for x in stdin.readline().rstrip().split()]
print((b//x) - (a-1)//x)

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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


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


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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

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

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

Submission status: Accepted

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

result = b // x - ~-a // x
print(result)
# result = [i % x for i in range(a, b + 1)].count(0)
# print(result)

Submission status: Accepted

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


def count(a, n):
    return a // n

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

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
def count(a,n):return a//n
print(count(b,c)-count(a-1,c))

Submission status: Accepted

Solution code:
# ABC 046 B

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

nb = b // x + 1
na = (a - 1) // x + 1 if a != 0 else 0

num = nb - na

print(num)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

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

def f(p,q): 
    if p<0:
        return(0)
    else:
        return((p+q)//q)
print(f(b,x) - f(a-1,x))

Submission status: Accepted

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

if a % x != 0:
    temp = a + (x - a % x)
else:
    temp = a

if temp > b:
    print(0)
    exit()
else:
    print((b - temp) // x + 1)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
a, b, x = [int(_) for _ in input().split()]
x_a = a // x + int(a % x != 0)
x_b = b // x
print(x_b - x_a + 1)

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
from operator import itemgetter
#以下てんぷら
def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")

def ip():
    return int(input())
#n = ip()                                     #入力整数1つ
x,y,z= (int(i) for i in input().split())       #入力整数横2つ以上
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[input() for i in range(x)]    #入力セット(整数改行あり)(2/2)

#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
#こっから本文
low = (x//z)*z
if low < x: low+=z
high = (y//z)*z
print((high - low)//z+1)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b, x = map(int, input().split())
def division(n):
    if 0 <= n:
        return n//x + 1
    if n == -1:
        return 0


print(division(b) - division(a-1))

Submission status: Accepted

Solution code:
""" AtCoder """

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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 = (a-1)//x
    xb = b//x
    return xb-xa


print(solve1())

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys

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

if __name__ == "__main__":
	main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(M-m)

Submission status: Accepted

Solution code:
a,b,x = [int(_) for _ in input().split()]
c =0
def get_num(rare,ru):
        return rare//ru+1 if rare >= 0 else 0
print(get_num(b,x)-get_num(a-1,x))

Submission status: Accepted

Solution code:
def f(n, x):
    if n >= 0:
        return n // x + 1
    elif n == -1:
        return 0


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def func(i):
    if i != -1:
        return i//x+ 1
    else:
        return 0

print(func(b) - func(a-1))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
abx = list(map(int, input().split()))
if 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: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, x = map(int, input().split())
y = b - a + 1
if (y % x == 0):
  print(y // x)
else:
  z = y // x
  a2 = a + x * z
  x1 = a if (a % x == 0) else a + (x - (a % x))
  x2 = x1 + x * z
  if (x2 <= b):
    print(z + 1)
  else:
    print(z)

Submission status: Accepted

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

Submission status: Accepted

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 = a // x - 1
    else:
        D2 = a // x
    print(D1 - D2)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**8) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

a,b,x = li()
left = x* -(-a//x)
right = x * (b//x)
print((right-left)//x + 1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = input().split()
i = int(a[0])
d = int(a[1])
x = int(a[2])
rd = d // x
ri = (i - 1) // x
if (ri < 0):
	ri = -1
print(rd - ri)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input().split()
b = []
b.append(int(a[0]))
b.append(int(a[1]))
b.append(int(a[2]))
x = b[1] // b[2]
y = (b[0] - 1) // b[2]
print(x - y)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(200000)


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


def solve():
    a, b, x = il()
    return b // x - (a - 1) // x


if __name__ == "__main__":
    print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def count(a,b,c):
    r = b // c - a // c
    if a % c == 0:
        r += 1
    return r
if a == 0:
    ans = count(a+1,b,c) + 1
else : ans = count(a,b,c)
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

    aflag, bflag = a % x, b % x

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(B//X - (A-1)//X)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
int_a, int_b, int_x = map(int, input().split())


print((int_b // int_x) - ((int_a - 1) // int_x))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,x=map(int,input().split())
print(b//x-(a-1)//x)
#コピペです。

Submission status: Accepted

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


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


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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

a, b, x = map(int,input().split())
cnt = f(b,x)-f(a-1,x)

print(cnt)

Submission status: Accepted

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

#aの商と余り、bの商を求める
qa = a // x
qb = b // x
ra = a % x
#bの商からaの商を引く
ans = qb - qa

#ここまでの操作で、a以外の値の内、xで割り切れる値の数がansに入っているため、
#aが割り切れるかどうかで条件分岐させる
if ra == 0:
  print(ans+1)
else:
  print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://beta.atcoder.jp/contests/abc048/tasks/abc048_b


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


def solve():
    a, b, x = map(int, input().split())
    print(div(b, x) - div(a - 1, x))


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

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

count_a=a//x
count_b=b//x

if(a%x==0):
    count_a -= 1

count=count_b - count_a

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count_a = a //x
count_b = b // x

if a % x == 0:
    count_a -= 1

ans = count_b - count_a
    
print(ans)

Submission status: Accepted

Solution code:
# input
import math

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

# 0,...,nの中でxで割り切れるのは
# 0, x, 2x,..., (n // x)* x の(n //x) + 1個

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

Submission status: Accepted

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

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

print(v1 - v2)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

def f(n):
    # 0<=i<=nで条件を満たすものの個数
    global x
    if n==-1:
        return 0
    else:
        return n//x + 1
    
print(f(b)-f(a-1))

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8

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

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

Submission status: Accepted

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

Submission status: Accepted

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

nb = b // x + 1
na = (a-1) // x + 1 if a > 0 else 0

print(nb - na)

Submission status: Accepted

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 + 1 )

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,x=map(int,input().split())
first=a-a%x+x
if(first==a+x):
  first=a
last=b-b%x

print(last//x - first//x +1)

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
il = lambda func=int: list(map(func, stdin.readline().rstrip().split()))
ils = lambda n, s="int(input())": [eval(s) for _ in range(n)]

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

Submission status: Accepted

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

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

print(B - A)

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    a = next_int()
    b = next_int()
    x = next_int()

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

    print(ans)

def next_int() -> int:
    return int(next_str())


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin

a,b,x = [int(x) for x in stdin.readline().rstrip().split()]

s = b//x
t = a//x
if a % x == 0:
    u = 1
else:
    u = 0

print(s-t+u)

Submission status: Accepted

Solution code:
#! /usr/bin/python3
# Between a and b ...

"""
非負の整数 a, b (a≤b) と、正の整数 x が与えられます。
a 以上 b 以下の整数のうち、x で割り切れるものの個数を求めてください。
"""

test_mode = False

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

if a%x != 0:
    limit_min = a//x +1
else:
    limit_min = a//x

limit_max = b//x


ans = limit_max - limit_min + 1

print(ans)

Submission status: Accepted

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