Problem:


Score : 200 points

Problem Statement

You are given nonnegative integers a and b (a ≤ b), and a positive integer x.
Among the integers between a and b, inclusive, how many are divisible by x?

Constraints

0 ≤ a ≤ b ≤ 10^{18}

1 ≤ x ≤ 10^{18}

Input

The input is given from Standard Input in the following format:

a b x

Output

Print the number of the integers between a and b, inclusive, that are divisible by x.

Sample Input 1

4 8 2

Sample Output 1

3

There are three integers between 4 and 8, inclusive, that are divisible by 2: 4, 6 and 8.

Sample Input 2

0 5 1

Sample Output 2

6

There are six integers between 0 and 5, inclusive, that are divisible by 1: 0, 1, 2, 3, 4 and 5.

Sample Input 3

9 9 2

Sample Output 3

0

There are no integer between 9 and 9, inclusive, that is divisible by 2.

Sample Input 4

1 1000000000000000000 3

Sample Output 4

333333333333333333

Watch out for integer overflows.



Sample input:
4 8 2


Sample output:
3

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

if b == 0:
  print(0)

s = math.floor(b / x)

if a == 0:
  print(s + 1)
else:
  k = math.floor((a - 1) / x)
  print(s - k)

Submission status: Wrong Answer

Solution code:
import math

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

s = math.floor(b / x)

if a == 0:
  print(s + 1)
else:
  k = math.floor((a - 1) / x)
  print(s - k)

Submission status: Wrong Answer

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)
else:
    A = 1 + a // x
    print(B - A)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def warikire(n,r):
    if r==1:
        return n+1
    else:
        return n//r
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: Wrong Answer

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

if b == 0:
  mx = 1
else:
  mx = b // x
if a == 0:
  before = 0
else:
  before = (a - 1) // x

print(mx - before)

Submission status: Wrong Answer

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

max = b // x
if a == 0:
  before = 0
else:
  before = (a - 1) // x

print(max - before)

Submission status: Wrong Answer

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

cnt = 0

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

Submission status: Wrong Answer

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

first = math.ceil(a/x)
end = b//x

if a!=0:
  print(end - first + 1)
else:
  print(end - first)

Submission status: Wrong Answer

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

first = math.ceil(a/x)
end = b//x

print(end - first + 1)

Submission status: Wrong Answer

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

first = math.ceil(a/x)
end = b//x

Submission status: Wrong Answer

Solution code:
import sys
a,b,x=map(int,input().split())
count = 0
ans = 0
for i in range(a,b+1):
    if i%x==0:
        count += 1
        ans = i
        break
while True:
    if ans == 0:
        break
    elif ans < b:
        ans += x
        count += 1
    else:
        break

print(count)

Submission status: Wrong Answer

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

if (b-a) < 10 ** 5:
    count = 0
    for i in range(a, b+1):
        if i % x == 0:
            count += 1
    print(count)
    exit()

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

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# AtCoder Beginner Contest 048 - B
# -*- encoding: UTF-8 -*-

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

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

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

result = 0

x_num = int(x_max - x_min + 1)

print(x_num)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if x>b:
    print(0)
elif x<a:
    if a%x==0 or b%x==0:
        tmp += 1
    print((b-a)//x+tmp)
else:
    if b-a>=x:
        if a%x==0 or b%x==0:
            tmp += 1
        print((b-a)//x+tmp)
    else:
        if a%x+b%x==x:
            tmp += 1
        print(tmp)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if x>b:
    print(cnt)
elif x<a:
    if a%x==0:
        tmp = a
    else:
        tmp = x*(a//x+1)
    if tmp>b:
        print(cnt)
    else:
        while True:
            tmp += x
            if tmp<=b:
                cnt += 1
            else:
                break
        print(cnt)
    
else:
    while True:
        if tmp<=b:
            cnt += 1
            tmp += x
        else:
            break
    print(cnt)

Submission status: Wrong Answer

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

if x>b:
    print(cnt)
elif x<a:
    if a%x==0:
        tmp = a
    else:
        tmp = x*(a//x+1)
    if tmp>b:
        print(cnt)
    else:
        while True:
            tmp += x
            if tmp<=b:
                cnt += 1
            else:
                break
        print(cnt)
    
else:
    while True:
        if x<=b:
            cnt += 1
            x += x
        else:
            break
    print(cnt)

Submission status: Wrong Answer

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

if x>b:
    print(cnt)
elif x<a:
    if a%x==0:
        tmp = a
    else:
        tmp = x*(a//x+1)
        
    if tmp%x==0 and tmp<=b:
        cnt += 1
    while True:
        tmp += x
        if tmp<=b:
            cnt += 1
        else:
            break
    print(cnt)
    
else:
    print((b-a)//x+1)

Submission status: Wrong Answer

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

while True:
    a += x
    if a<=b:
        cnt += 1
    else:
        break
print(cnt)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
if a%2==0:
    cnt = 1
else:
    cnt = 0
tmp = a

while True:
    tmp += x
    if tmp<=b:
        cnt += 1
    else:
        break
print(cnt)

Submission status: Wrong Answer

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

if a == 0:
    a_div = 0
if b == 0:
    b_div = 0

ans = b_div - a_div
print(ans)

Submission status: Wrong Answer

Solution code:
from decimal import *
a, b, x = map(Decimal, input().split())
dif = b - a
ans = dif // x
if a % x == 0:
    ans += 1
elif b % x == 0:
    ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

an = a//x + 1
bn = b//x + 1

print(bn - an)

Submission status: Wrong Answer

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

bn = (-b%x)+b
an = (-a%x)+a

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
data = [int(i) for i in input().split(" ")]
total = 0
if data[0] != data[1]:
  for i in range(data[0],data[1]+1):
    if i % data[2] == 0:
      total += 1
print(total)

Submission status: Wrong Answer

Solution code:
data = [int(i) for i in input().split(" ")]
total = 0
if data[0] != data[1]:
  for i in range(data[0],data[1]+1):
    total += 1
print(total)

Submission status: Wrong Answer

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

print(b//x-(max((a-1)//x,0)))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = (a - b) // x

if a % x == 0:
  ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def hoge(a,x):
  return a//x

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

if a == b:
  ans = 0
else:
  ans = hoge(b,x) - hoge(a-1,x)
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if x <= b:
    print(int(b) // int(x) - int(a) // int(x))
else:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys, math

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

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(b//c - (a-1)//c if a > 0 else b//c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

count = 0
i = 1
while x*i <= b:
    if a <= x*i:
        count += 1
    i += 1
print(count)

Submission status: Wrong Answer

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

if a % x == 0:
    y1 = a
elif a < x:
    y1 = x
else:
    y1 = a + a % x


y2 = b - b % x

n = (y2 - y1) // x + 1
print(n)

Submission status: Wrong Answer

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

if a % x == 0:
    y1 = a
elif a < x:
    y1 = a + x % a
else:
    y1 = a + a % x

y2 = b - b % x

n = (y2 - y1) // x + 1
print(n)

Submission status: Wrong Answer

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

y1 = a + a % x

y2 = b - b % x

n = (y2 - y1) // x + 1
print(n)

Submission status: Wrong Answer

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

y1 = a - a % x

y2 = b - b % x

n = (y2 - y1) // x
print(n)

Submission status: Wrong Answer

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

if a % x == 0:
    y1 = a
else:
    y1 = a - a % x

if b % x == 0:
    y2 = b
else:
    y2 = b - b % x

n = (y2 - y1)//x
print(n)

Submission status: Wrong Answer

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

if a % x == 0:
    y1 = a
else:
    y1 = a - a % x

if b % x == 0:
    y2 = b
else:
    y2 = b - b % x

n = int((y2 - y1) / x) + 1
print(n)

Submission status: Wrong Answer

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

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

n = int((b - tmp) / x) + 1
print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0

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

Submission status: Wrong Answer

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

cnt = 0

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

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
ans = 0
# for i in range(a,b + 1):
#   if i % x == 0:
#
#   ans += 1
if b == 0:
  print(0)
elif a == 0 and x != 1:
  print(b//x)
elif x != 1:
  ans += (b - a) // x
  if b % x == 0:
    ans += 1
  print(ans)
else:
  print(b - a + 1)

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
ans = 0
# for i in range(a,b + 1):
#   if i % x == 0:
#
#   ans += 1
if b == 0:
  print(0)
elif a == 0:
  print(b//x)
elif x != 1:
  ans += (b - a) // x
  if b % x == 0:
    ans += 1
  print(ans)
else:
  print(b - a + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import sys

input = sys.stdin.readline

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

main()

Submission status: Wrong Answer

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

import sys

input = sys.stdin.readline

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

main()

Submission status: Wrong Answer

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

import math

#b以下で最大のxの倍数は

bika=b//x

#a以上で最小のxの倍数は

aijo=math.ceil(a/x)

print(bika-aijo+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin

a,b,x = [int(x) for x in stdin.readline().rstrip().split()]
point = 0
if a == 0:
    point -= 1
if a%x == 0:
    point += 1

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

print(point)

Submission status: Wrong Answer

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


#print((a/x).is_integer())

if (a/x).is_integer() == True:
    #print("BBBBBBBBBB")
    print((b//x)-(a//x)+1)

elif (a/x).is_integer() == False:
    #print("aaaaaaaaaaaaaa")
    print((b//x)-(a//x))

Submission status: Wrong Answer

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

count = 0
if a == 0:
    count = 1

#print((a/x).is_integer())

if (a/x).is_integer() == True:
    #print("BBBBBBBBBB")
    print((b//x)-(a//x)+1)

if (a/x).is_integer() == False:
    #print("aaaaaaaaaaaaaa")
    print((b//x)-(a//x))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if (a/2).is_integer():
    print((b//x -a//x) +1)
else:
    print(b//x -a//x)

Submission status: Wrong Answer

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

if a == 0 and b == 0:
    print(0)
    exit()

if b % x != 0:
    q = b//x
else:
    q = b/x

if a % x != 0:
    p = a//x
else:
    p = a/x - 1
print(int(q - p))

Submission status: Wrong Answer

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

if b % x != 0:
    q = b//x
else:
    q = b/x

if a % x != 0:
    p = a//x
else:
    p = a/x - 1
print(int(q - p))

Submission status: Wrong Answer

Solution code:
import math

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

if b % x != 0:
    q = math.floor(b/x)
else:
    q = b/x

if a % x != 0:
    p = math.floor(a/x)
else:
    p = a/x - 1
print(int(q - p))

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

if a < b:
    count = 0
    high = b // x
    low = a // x
    ans = high - low + 1
    print(ans)
else:
    print(0)

Submission status: Wrong Answer

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

count = 0
high = b // x
low = a // x
ans = high - low + 1

print(ans)

Submission status: Wrong Answer

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

count = 0
ans = (b - a) // x
if a % 2 == 0:
    ans += 1
elif b % 2 == 0:
    ans += 1

print(ans)

Submission status: Wrong Answer

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

count = 0
ans = (b - a) / x
if a % 2 == 0:
    ans += 1
elif b % 2 == 0:
    ans += 1

print(ans)

Submission status: Wrong Answer

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

count = 0
ans = (b - a) / x
if a % 2 == 0:
    ans += 1

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

count = 0
while a < b:
    if a % 2 == 0:
        count += 1
    a += 1

print(count)

Submission status: Wrong Answer

Solution code:
L = input().split(" ")
a = int(L[0])
b = int(L[1])
x = int(L[2])
m = 0
for i in range(a, b + 1, x):
    m += 1
print(m)

Submission status: Wrong Answer

Solution code:
from math import ceil

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

print(b//x-ceil(a/x)+1) # b以下の最大の倍数、a以上の最小の倍数の個数

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if start > end:
    print(0)
    exit()

result = (end - start) // x + 1
if a == 0:
    result += 1
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

ans1 = b//x
ans2 = a//x

#print(ans1)
#print(ans2)

if b%x == 0:
	print(ans1-ans2+1)
else:
	print(ans1-ans2)

Submission status: Wrong Answer

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

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

ans1 = b//x
ans2 = a//x

print(ans1)
print(ans2)

if b%x == 0:
	print(ans1-ans2+1)
else:
	print(ans1-ans2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ax = a // x if a % 2 else a // x - 1
bx = b // x

print(bx-ax)

Submission status: Wrong Answer

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

x_s = a+(x-a%x) if a%x else a
x_e = b-(b%x) if a%x else b

print(int((x_e - x_s) / x + 1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,x = map(int,input().split())
count=0
i=0
while a<=a-a%x+i*x<=b:
  count +=1
  i +=1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A = list(map(int,input().split()))
a=A[0]
b=A[1]
x=A[2]
s = 0
n = 0
if (a%x == 0)and(b%x == 0):
  b = b 
  s = (b - a) // x
  print(int(s +1))
elif (a == 0):
  b = b 
  s = (b - a) // x
  print(int(s +1))
elif (a == 0) and (b == 0):
  s = (b - a) // x
  print(int(s +1))
else:
  b = b + 1
  s = (b - a) // x
  print(int(s))

Submission status: Wrong Answer

Solution code:
A = list(map(int,input().split()))
a=A[0]
b=A[1]
x=A[2]
s = 0
n = 0
if (a%x == 0)and(b%x == 0):
  b = b 
  s = (b - a) // x
  print(int(s +1))
elif (a == 0) and (b % x == 0):
  b = b 
  s = (b - a) // x
  print(int(s +1))
else:
  s = (b - a) // x
  print(int(s+1))

Submission status: Wrong Answer

Solution code:
A = list(map(int,input().split()))
a=A[0]
b=A[1]
x=A[2]
s = 0
n = 0
if (a%x == 0)and(b%x == 0):
  b = b 
  s = (b - a) // x
  print(int(s +1))
elif (a == 0) and (b % x == 0):
  b = b 
  s = (b - a) // x
  print(int(s +1))
else:
  b = b + 1
  s = (b - a) // x
  print(int(s))

Submission status: Wrong Answer

Solution code:
A = list(map(int,input().split()))
a=A[0]
b=A[1]
x=A[2]
s = 0
n = 0
if (a%x == 0)and(b%x == 0):
  b = b 
  s = (b - a) // x
  print(int(s +1))
elif a == 0:
  b = b 
  s = (b - a) // x
  print(int(s +1))
else:
  b = b + 1
  s = (b - a) // x
  print(int(s))

Submission status: Wrong Answer

Solution code:
A = list(map(int,input().split()))
a=A[0]
b=A[1]
x=A[2]
s = 0
n = 0
if (a%x == 0)and(b%x == 0):
  b = b 
  s = (b - a) // x
  print(int(s +1))
else:
  b = b + 1
  s = (b - a) // x
  print(int(s))

Submission status: Wrong Answer

Solution code:
A = list(map(int,input().split()))
a=A[0]
b=A[1]
x=A[2]
s = 0
n = 0
if (a%2 == 0)and(b%2 == 0): 
  s = (b - a) // x
  print(int(s +1))
else:
  s = (b - a) // x
  print(int(s+1))

Submission status: Wrong Answer

Solution code:
A = list(map(int,input().split()))
a=A[0]
b=A[1]
x=A[2]
s = 0
n = 0
if (a%2 == 0)and(b%2 == 0):
  b = b 
  s = (b - a) // x
  print(int(s +1))
else:
  b = b 
  s = (b - a) // x
  print(int(s))