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

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

Submission status: Accepted

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

c=b//x
d=(a-1)//x
print(c-d)

Submission status: Accepted

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

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

Submission status: Accepted

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

def f(n, x = 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())
b = b//x
a = a//x-1 if a%x==0 else a//x
print(b-a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

pl = 0

if a % x == 0:
    pl = 1

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

Submission status: Accepted

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

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

print(max((b//x - a//x + n), 0))

Submission status: Accepted

Solution code:
row = list(map(int, input().split()))

def func(n):
    if n < 0:
        f = 0
    else:
        f = n//row[2]+1
    return f

print(func(row[1])-func(row[0]-1))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
from sys import stdin
a,b,x = [int(x) for x in stdin.readline().rstrip().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())
nb=b//x
na=(a-1)//x
print(nb-na)

Submission status: Accepted

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

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

print(s-t)

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if a%x==0:
    nl=a
else:
    nl=a-a%x+x
if b%x==0:
    nr=b
else:
    nr=b-b%x

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

Submission status: Accepted

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

i = b//x

j = (a - 1) // x 

print(i - j)

Submission status: Accepted

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

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

    # mod = [i for i in range(a, b + 1) if i % x == 0]
    # print(len(mod))

if __name__ == "__main__":

    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18

A, B, X = list(map(Decimal, sys.stdin.readline().split()))

ans = math.floor(B / X) - math.ceil(A / X) + 1
print(ans)

Submission status: Accepted

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

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

print(b_div - a_div)

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = f(b) - f(a-1)

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
p=input().rstrip().split(' ')
a=int(p[0])
b=int(p[1])
x=int(p[2])
d=(b//x) - (a//x)
if a%x==0:
    d+=1;
print(d)

Submission status: Accepted

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

a, b, x = nl()

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

Submission status: Accepted

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

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

print(B-preA)

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())
c = -((-1 * a)//x)
d = b // x
print(d - c + 1)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, x = map(int, input().split())
m = a // x  # 切り捨て
n = b // x
ans = n - m
if a % x == 0:
    ans += 1
print(ans)

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

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

Submission status: Accepted

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

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(int(b//x)-int((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, 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())

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

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

print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

Solution code:
import math
def main(a, b, x):
    b_floor = b // x

    if(a % x > 0):
        a_ceil = a // x + 1
    else:
        a_ceil = a // x

    print(b_floor - a_ceil + 1)

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

def test1(capsys):
    inputs = [4, 8, 2]
    out = 3
    main(*inputs)
    captured = capsys.readouterr()    
    assert captured.out == str(out) + '\n'

def test3(capsys):
    inputs = [0, 5, 1]
    out = 6
    main(*inputs)
    captured = capsys.readouterr()    
    assert captured.out == str(out) + '\n'

def test4(capsys):
    inputs = [9, 9, 2]
    out = 0
    main(*inputs)
    captured = capsys.readouterr()    
    assert captured.out == str(out) + '\n'

def test5(capsys):
    inputs = [1, 1000000000000000000, 3]
    out = 333333333333333333
    main(*inputs)
    captured = capsys.readouterr()    
    assert captured.out == str(out) + '\n'

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


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


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

Submission status: Accepted

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

#bまでで割り切れるものーaまでで割り切れるもの
if a % x == 0:
    print((b//x) - (a//x) + 1)
else:
    print((b//x) - (a//x))

Submission status: Accepted

Solution code:
def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [A, B, X] = list(map(lambda x: int(x), inputs[0].split()))
    num = (B // X) - ((A - 1) // X)
    return num


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Accepted

Solution code:
# 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())
answer=b//x-a//x
if a%x==0:
    answer+=1
print(answer)

Submission status: Accepted

Solution code:
a, b, x = map(int, input().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())
a_ans = (a-1) // x
b_ans = b // x
print("{}".format(b_ans-a_ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding: utf-8

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

upper = b // x
lower = a // x

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

ans = int(upper - lower)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def get(a,x):
    if a<0:
        return 0
    return a//x + 1

def solve():
    a,b,x = f()

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



solve()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(d-c)

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - Between a and b ...
https://atcoder.jp/contests/abc048/tasks/abc048_b

"""
import sys


def solve(a, b, x):
    q, r = divmod(b, x)
    b -= r
    a = ((a + x - 1)//x) * x
    if a > b:
        return 0
    return (b - a)//x + 1


def main(args):
    a, b, x = map(int, input().split())
    ans = solve(a, b, x)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, x = [int(i) for i in input().split()]
def f(n):
    return 0 if n < 0 else 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:
    k = 1
else:
    k = 0
print(b//x-a//x+k)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def numd(n,x):
    return (n+x) // x

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

Submission status: Accepted

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

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

Submission status: Accepted

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

a, b, x = 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()))
result = B // X - A // X if A % X != 0 else B // X - A // X + 1
print(result)

Submission status: Accepted

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

m=b//x
n=a//x
k=a%x

if k==0:
  print(m-n+1)
else:
  print(m-n)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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(int(b//x) - int((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 0))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(nb - na)

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = calc(b) - calc(a-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(" "))
a += a%x and x
a //= x
b //= x
print(b-a+1)

Submission status: Accepted

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

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

    print(result)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
v = input().split(" ")

a = int(v[0])
b = int(v[1])
x = int(v[2])

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

print(max(fb-fa, 0))

Submission status: Accepted

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

Submission status: Accepted

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

lower = (a+x-1) // x
upper = b // x

if lower < upper:
    ans = upper - lower + 1

elif lower == upper:
    ans = 1

else:
    ans = 0

print(ans)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, x = map(int, input().split())
if a != 0:
    print(b//x - (a-1)//x)
elif a == 0:
    print(b//x + 1) # 0も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:
from decimal import Decimal

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


a_deci = Decimal(a)
b_deci = Decimal(b)
x_deci = Decimal(x)

count = int(b_deci/x_deci)
count = count -int(a_deci/x_deci)
if a_deci%x_deci==0:
    count = count+1


print(count)

Submission status: Accepted

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

def solve(a, b, x):
    print(b//x - (a-1)//x) 

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

Submission status: Accepted

Solution code:
def solve():
    a,b,x = [int(_) for _ in raw_input().split()]
    count = b/x - (a-1)/x
    print str(count)

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:


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

def submit():
    # nをmで割った商の切り上げ
    def divide_ceil(n, m):
        if n % m == 0:
            return n // m
        return n // m + 1

    # nをmで割った商の切捨て
    def divide_floor(n, m):
        return n // m

    a, b, x = read_input()

    a_coef = divide_ceil(a, x)
    b_coef = divide_floor(b, x)

    print(b_coef - a_coef + 1)


if __name__ == '__main__':
    submit()

Submission status: Accepted

Solution code:
#not solved only by myself
a,b,x = map(int,input().split())

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


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

Submission status: Accepted

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

big = b // x + 1
small = (a - 1) // x + 1

ans = big - small
if ans < 0:
    ans = 0

print(ans)

Submission status: Accepted

Solution code:
[a,b,x] = list(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())

rema=a%x
remb=b%x

y=(a-rema)//x
z=(b-remb)//x

if a%x==0:
    print(z-y+1)
else:
    print(z-y)

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

Submission status: Accepted

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

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

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

print(j-i)

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 = [int(item) for item in input().split()]
upper = b//x
if a == 0:
    lower = 0
    upper += 1
else:
    lower = (a-1)//x
print(upper - lower)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    input = sys.stdin.readline
    try:
        a, b, x = map(int, input().split())
        def fn(n):
            if n == -1:
                return 0
            else:
                return n // x + 1
        print(fn(b) - fn(a-1))

    finally:
        input = None

import sys; sys.setrecursionlimit(50000)
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

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

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


if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- codoing 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, input().split())
c = b//x - (a-1)//x
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 一行目　
a, b, x = map(int, input().split())

all_count = 0
dev = 0
if b > 0:
    all_count = b // x

if a > 0:
    dev = (a-1) // x
else:
    dev = -1
print(all_count - dev)

Submission status: Accepted

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

c = a//x if a % x != 0 else a//x-1
ans = b//x-c

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

a, b, x = MAP()

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

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

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

cnt = 0

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

print(end - start)

Submission status: Accepted

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

count = 0

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

if b >= a + (x - a % x):
  p = b - a - (x - a % x)
  count += p // x + 1

print(count)

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

Submission status: Accepted

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

fb = b//x
fa1 = (a-1)//x
f = fb - fa1
print(f)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def between_a_and_b(a: int, b: int, x: int) -> int:
    return b // x - (a-1) // x


if __name__ == "__main__":
    a, b, x = map(int, input().split())
    ans = between_a_and_b(a, b, x)
    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())
ans = (b-a) // x
if a!= 0:
  ans = (b // x + 1) - ((a-1) // x + 1)
else:
  ans = (b // x + 1)
  
print(ans)

Submission status: Accepted

Solution code:
from functools import reduce

def main():
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]
    
    a, b, x = (int(_) for _ in input().split())
    a_d = a//x
    b_d = b//x
    ans = b_d - a_d
    if(a%x == 0):
        ans += 1
    print(ans)
if __name__ == '__main__':
    main()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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