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:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

a_below = int((a-1)//x)

b_below = int(b//x)

ans= b_below-a_below

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc048/tasks/abc048_b
# B問題だけど緑パフォ

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 f(v):
    i, j = divmod(v, x)
    return i


ai = f(a - 1)
bi = f(b)
ans = bi - ai
print(ans)

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())
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 = b//x - (a-1)//x
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29

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

if __name__=='__main__':
    main()

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())

a_a = a%x
b_a = b%x
maxx = b - b_a
minx = a - a_a
ans = (maxx-minx)//x
if a_a==0:
    ans+=1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B
def how_many(a, b, c):
    # 1からa-1までのcの倍数の個数と1からbまでのcの倍数の個数を求める
    A, B = (a-1)//c, b//c
    # それらを引いて答えが求まる
    return B-A

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

print(how_many(a, b, x))

Submission status: Accepted

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

Submission status: Accepted

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


def calc(y):
    return y // x


print(calc(b)-calc(a-1))

Submission status: Accepted

Solution code:
a,b,x = [int(i) for i in input().split()]
fb = (b//x) +1
if a != 0:
    fa = ((a-1)//x) + 1
else:
    fa = 0
print(fb-fa)

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 = list(map(int, input().split(' ')))

l = a // x
m = b // x
n = 1 if a % x == 0 else 0

print(m - l + n)

Submission status: Accepted

Solution code:
def f(n, x):
  """0 以上 n 以下の整数のうち、x で割り切れるものの個数"""
  return n // x + 1 if n >= 0 else 0
a, b, x = [int(i) for i in input().split()]
print(f(b, x) - f(a - 1, x))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(r)

Submission status: Accepted

Solution code:
def main():
    lower_limit, upper_limit, divisible_by = map(int, input().split())
    lower_limit -= 1
    print(upper_limit // divisible_by - lower_limit // divisible_by)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

max_i = b//x

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.buffer.readline

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a, b, x = [int(e) for e in input().split()]
    ac = 0 if a == 0 else (a - 1)//x + 1
    bc = b//x + 1
    print(bc - ac)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC048

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())

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

Submission status: Accepted

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

Submission status: Accepted

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

if a%x == 0 :
    first = a // x
else :
    first = ( a + x - a%x ) // x

if b%x == 0 :
    end = b // x
else :
    end = ( b - b%x ) // x

ans = end - first + 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, X = [int(s) for s in input().split()]

def main():
    a = A // X
    if A % X != 0:
        a += 1
    b = B // X
    print(b - a + 1)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import itertools
import math
import sys
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce
import sys
sys.setrecursionlimit(4100000)
from functools import lru_cache
INF = 1 << 60

#ここから書き始める
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())

p = 0
y = int(b//x) + 1

i = 1
#for i in range(1,y):
while x*i <= b:
    if a <= x*i:
        p = x*i
        break
    i += 1

if p != 0:
    t = b-p
    s = t//x
    ans = s + 1
    if a == 0:
        ans += 1
    print(ans)
elif a == 0:
    print(1)
else:
    print(0)

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(" "))
print((b // x) - ((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:
# -*- coding: utf-8 -*-

#----------
A,B,X = list(map(int, input().rstrip().split()))
#----------

index_start = A // X - (A % X == 0) 
index_end = B // X

print( index_end - index_start )

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, floor
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b, x = MAP()
cnt = 0
#for i in range(a, b+1):
#    if not i % x:
#        cnt += 1
#print(cnt)
#0->b  kara 0->a-1 wo hiku 
# kangae chuu
c = (a - 1) // x
d = b // x
print(d - c)

Submission status: Accepted

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

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

print(ans_high - ans_low)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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())
cnt=0
#for i in range(a,b+1):
#  if i%x==0: cnt+=1
#print(cnt)

cnt1=b//x
cnt2=(a-1)//x
print(cnt1-cnt2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,x =map(int,input().split())
#print(1000000000000000000/3)
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:
a, b, x = [int(x) for x in input().split()]
a = (a + x - 1)//x
b //= x
print(b - a + 1)

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())
if a%x == 0:
    buf1 = a//x - 1
else:
    buf1 = a//x

buf2 = b//x

print(buf2 - buf1)

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())

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

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

i = 0
fa = x*i
while x*i < a:
  i += 1
  fa = x*i

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

r = a % c == 0 if 1 else 0
ans = b//c - a//c + r

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(a: int, b: int, x: int):
    B = b//x + 1
    A = (a-1)//x + 1
    print(B-A)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    x = int(next(tokens))  # type: int
    solve(a, b, x)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    A, B, X = [int(x) for x in input().split()]
    print(B // X - (A - 1) // X)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

if (a - 1) < 0:
    count_a = 0
else:
    count_a = (a - 1) // x + 1

count_b = b // x + 1

print(count_b - count_a)

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 2, Feb, 2020
"""

import sys
import itertools

import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007

#+++++

def main():
	a,b,x = IN()
	rb=b//x
	ra=(a-1)//x
	ret= rb-ra
	print(ret)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
# coding: utf-8
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())
ans = b // x - (a-1)//x
print(ans)

Submission status: Accepted

Solution code:
def solve(a, b, x):
    return b // x - (a - 1) // x

_a, _b ,_x = map(int, input().split())
print(solve(_a, _b, _x))

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, input().split())
print(b//x-(a-1)//x if a>0 else b//x+1)

Submission status: Accepted

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

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

print(r-l+1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b, x = [int(i) for i in 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:
arr = input().split()
arr = list(map(int,arr))
a = arr[0]
b = arr[1]
x = arr[2]

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 = tuple(map(int, input().split()))

if x == 0:
    print("0")
elif x == 1:
    print(len(range(a, b+1)))
else:
    cnt_b = b // x
    cnt_a = (a-1) // x
    print(cnt_b - cnt_a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

result = to_b - to_a

print(result)

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:
a, b, x = map(int,input().split())

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

print(int(r))

Submission status: Accepted

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

ans = b//x - a//x + int(not(a%x))
print(ans)

Submission status: Accepted

Solution code:
a, b, x = [int(_) for _ in 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%x == 0:
    print(b//x-a//x+1)
else:
    print(b//x-a//x)

Submission status: Accepted

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

Submission status: Accepted

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

B = b // x

print(B - A + 1)

Submission status: Accepted

Solution code:
#python3

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

main()

Submission status: Accepted

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

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())

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

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a,b,x=INTM()
    if a>=1:
        cta=(a-1)//x+1
    else:
        cta=0
    ctb=b//x+1
    print(ctb-cta)
if __name__ == '__main__':
    do()

Submission status: Accepted

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


def hoge(n, x):
    return max(n // x + 1, 0)


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

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:
import sys
input = sys.stdin.readline
a,b,x=map(int,input().split())
print(b//x-(a-1)//x)

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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())
ans_a=(a-1)//x
ans_b=b//x
print(ans_b-ans_a)

Submission status: Accepted

Solution code:

def aandb():
    a, b, x = map(int, input().split())
    count_a = (a - 1) // x
    count_b = b // x


    print(count_b - count_a)

aandb()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
a, b, x = [int(x) for x in input().split()]
B = 1 + b // x
if a == 0:
    print(B)
elif a % x == 0:
    A = 1 + a // x
    print(B - A + 1)
else:
    A = 1 + a // x
    print(B - A)

Submission status: Accepted

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

cnta = max((a - 1) // x + 1, 0)
cntb = b // x + 1

print(cntb - cnta)

Submission status: Accepted

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

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

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

print(bn - an)

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:
abx = input().split()
a, b, x = int(abx[0]), int(abx[1]), int(abx[2])
print(int(b//x) - int((a-1)//x))

Submission status: Accepted

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

Submission status: Accepted

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

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 = [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())
zenbu = b // x +1
tmp = 0
if a % x == 0:
    tmp += 1
bubun = a // x +1
ans = zenbu - bubun + tmp
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

a, b, x = MAP()

# 区間和っぽくやる
l = (a-1) // x
r = b // x
print(r - l)

Submission status: Accepted

Solution code:
from decimal import *
a, b, x = map(Decimal, input().split())
if a == 0:
    a_div = 0
else:
    a_div = (a-1) // x + 1
b_div = b // x + 1

ans = b_div - a_div
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

an = (a-1)//x + 1
bn = b//x + 1

print(bn - an)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import decimal
import math

a, b, x = map(decimal.Decimal, input().split())

min_x_fac = math.floor(a / x) 
max_x_fac = math.floor(b / x)

count = max_x_fac - min_x_fac
if a % x == 0:
    count += 1

print(count)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import numpy as np
# import math
import sys
input = sys.stdin.readline


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

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

    print(res)



main()

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:
abx=list(map(int,input().split()))
def d(a,b):
    if a<0:
        return -1
    else:
        return a//b
a=d(abx[0]-1,abx[2])
b=d(abx[1],abx[2])
print(b-a)

Submission status: Accepted

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

def f(n, x):
    if n == -1:
        return 0
    return 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 = map(int, input().split())

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

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

Submission status: Accepted

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

if a % x == 0:
    ans = 1
else:
    ans = 0
            
a = a // x 
b = b // x

ans += b - a
print(ans)

Submission status: Accepted

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

n = a % x
m = b % x

if n == 0:
    ca = a
else:
    ca = a + (x - n)
    if ca > b:
        flag = False

if m == 0:
    cb = b
else:
    cb = b - m

if flag:
    print((cb - ca) // x + 1)
else:
    print(0)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
a, b, x = map(int, input().split())
#A = str(input())

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

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//x+(a%x==0))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, x = [int(n) for n in input().split()]
 
qa = a // x
qb = b // x
ra = a % x
rb = b % x
res = qb - qa
if ra == 0:
    res += 1
 
print(res)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

ans = b_n - a_n
ans = ans + 1 if a % x == 0 else ans

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(str(ans))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


m()

Submission status: Accepted

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

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