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: Time Limit Exceeded

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

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

    print(cnt)


resolve()

Submission status: Time Limit Exceeded

Solution code:
from decimal import *
#exp = Decimal(10**23)
#rint((Decimal(11)*exp)/Decimal(10))

## coding: UTF-8
s = input().split()
t = [int(p) for p in s]
#print(t)

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

start = a
goal = b
while True:
    if(start % x == 0):
        break
    else:
        start += 1
#print(start)
while True:
    if(goal % x == 0):
        break
    else:
        goal -= 1
#start = Decimal(3)
#goal = Decimal(999999999999999999)

#print(Decimal(goal))
print(Decimal(Decimal(Decimal(goal) - Decimal(start)) / Decimal(x)) + Decimal(1)  ) 
#answer = ((goal - start) / x ) + 1
#print('{}'.format(int(answer)))

Submission status: Time Limit Exceeded

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

a, b, x = map(int, input().split(' '))
p = -1
ans = 0
while True:
    p += 1
    num = x * p
    if num < a:
        continue
    if num > b:
        break
    ans += 1
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
A,B,X=map(int,input().split())
ans=0
for k in range(A,B+1):
    if k%X==0:
        ans +=1
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
a,b,x=map(int,input().split())
numbers=[int(c) for c in range(b+1) if c>=a]
count=0
for d in numbers:
    if d%x==0:
        count+=1
    else:
        pass
print(count)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
A,B,C=map(int,input().split())
cnt=0
for i in range(A,B+1):
  if i%C==0:
    cnt+=1
print(cnt)

Submission status: Time Limit Exceeded

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

print(count)

Submission status: Time Limit Exceeded

Solution code:
import sys
sys.setrecursionlimit(99999999)

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

r = 0

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

print(r)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

print(ans)

Submission status: Time Limit Exceeded

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

ans = 0
p = a
while p <= b:
    if p%x == 0:
        break
    p += 1

t = b-p
s = t//x
ans = s + 1

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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)

Submission status: Time Limit Exceeded

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

counter = 0
if x % 2 == 0:
  for i in range(a, b+1, 2):
    if i % x == 0:
      counter += 1
else:
  for i in range(a, b+1):
    if i % x == 0:
      counter += 1

print(counter)

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

l = []

count = 0

for i in range(b - a + 1):
    l.append(a + i)

for i in l:
    if i % x == 0:
        count += 1

print(count)

Submission status: Time Limit Exceeded

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

l = []

for i in range(a, b+1):
  l.append(i)
  
co = 0

for i in range(len(l)):
  if l[i] % x == 0:
    co += 1

print(co)

Submission status: Time Limit Exceeded

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

c = a
left = 0
while(True):
    if c % x == 0:
        left = c
        break
    else:
        c += 1

c = b
while(True):
    if c % x == 0:
        right = c
        break
    else:
        c -= 1

print((right - left) // x + 1)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys
import numpy as np
from collections import deque as deq

A, B, X = map(int, input().split())
R = 0

for i in range(A, B + 1):
    R += 1 if i % X == 0 else 0

print(R)

Submission status: Time Limit Exceeded

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

r = 0

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

print(r)

Submission status: Time Limit Exceeded

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

count=0

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

print(count)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

print(count)

Submission status: Time Limit Exceeded

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

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

print(count)

Submission status: Time Limit Exceeded

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)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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


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

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

if begin > end:
    print(0)
else:
    print((end - begin) // x + 1)

Submission status: Time Limit Exceeded

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


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

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

if begin > end:
    print(0)
else:
    print((end - begin) // x + 1)

Submission status: Time Limit Exceeded

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

count = 0

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

print(count)

Submission status: Time Limit Exceeded

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

for _ in range(b-a+1):
    if (a-x)%x==0:
        cnt += 1
    a += 1
    
print(cnt)

Submission status: Time Limit Exceeded

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

for i in range(b-a+1):
    if (a+i)%x==0:
        cnt += 1
print(cnt)

Submission status: Time Limit Exceeded

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

for num in range(a,b+1):
    if num%x==0:
        d=d+1
    else:
        pass
print(d)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a,b,x = map(int,input().split())
flag = False
for i in range(a,b+1):
    if i%x == 0:
        first = i
        flag = True
        break
if flag:
    print((b-i)//x+1)
else:
    print(0)

Submission status: Time Limit Exceeded

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)

Submission status: Time Limit Exceeded

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

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

print(ans)

Submission status: Time Limit Exceeded

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)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

ans = 0

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

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:

"""
https://atcoder.jp/contests/abc048/tasks/abc048_b
"""

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

ans = 0

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

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

cnt = 0
# a以上b以下の数字
for i in range(a,b+1):
    # 割り切れる数を数える
    if i%x==0:
        cnt+=1
        
print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

print(count)

Submission status: Time Limit Exceeded

Solution code:
abx=list(map(int,input().split()))
a=abx[0]
b=abx[1]
x=abx[2]
cnt=0
for i in range(a,b+1):
    if i%x==0:
        cnt=cnt+1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
x,y,z = map(int, input().split())

cnt = 0
for i in range(x,y+1):
    if(i % z==0):
        cnt = cnt +1
print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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)

Submission status: Time Limit Exceeded

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

start = a if a >= x else x
end = b
while start <= end:
    if start % x == 0:
        break
    if start == end:
        print(0)
        exit()
    start += 1

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

Submission status: Time Limit Exceeded

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

start = a
end = b
while start <= end:
    if start % x == 0:
        break
    if start == end:
        print(0)
        exit()
    start += 1

result = (end - start) // x + 1
print(result)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

num= range(a,b+1)

d =0

for c in num:
  if c%x == 0:
    d+=1
  else:
    pass

print(d)

Submission status: Time Limit Exceeded

Solution code:
a, b, x = map(int, input().split())
s = 0
for i in range(b-a+1): #aからbの中で最初にxで割り切れる数を探す
    if a % x == 0:
        break
    elif a % x != 0:
            a = a + 1
while (a+x*s) <= b:
    s = s + 1
print(s)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a, b, x = map(int, input().split())
s = 0
for i in range(b-a+1): #aからbの中で最初にxで割り切れる数を探す
    if a % x == 0:
        s = (b-a)//x + 1 #初めて割り切れた数からbまでの割り切れる数の個数
        break
    elif a % x != 0:
        a = a + 1
print(s)

Submission status: Time Limit Exceeded

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

print(count)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
A,B,C=map(int,input().split())
a=0
for i in range(A,B+1):
    if i%C==0:
        a=a+1
    else:
        a=a
print(a)

Submission status: Time Limit Exceeded

Solution code:
#B - Between a and b ...
a,b,x = map(int, input().split())

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

    max_dev = 0
    for i in range(a,b+1)[::-1]:
        if i%x==0:
            max_dev = i
            break

    print((max_dev-min_dev)//x+1)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
s = list(map(int, input().split()))
a,b,x = s[0],s[1],s[2]
ans = 0
for i in range(a, b+1):
    if i % x == 0:
        ans += 1
    else:
        continue
print(ans)

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
A, B, X = [int(_) for _ in stdin.readline().rstrip().split()]
ans = 0
for i in range(A, B+1):
  if i % X == 0:
    ans += 1
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def start_from(a, x):
  while a % x != 0:
    a += 1
  return a

def ends_with(b, x):
    while b % x != 0:
        b -= 1
    return b

def main():
  a, b, x = map(int, raw_input().split())
  start = start_from(a, x) / x
  end = ends_with(b, x) / x
  print(end-start+1)


main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys

i = list(map(int, input().split()))
count=0
for n in range(i[0],i[1]+1):
    if n%i[2]==0:
        count+=1

print(count)

Submission status: Time Limit Exceeded

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

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

print(n)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a,b,x = map(int, input().split())
s =[]
cnt=0
for i in range(a,b+1):
  s.append(i)
for j in s:
  if j %x==0:
    cnt +=1
print(cnt)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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)

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################

A, B, X = map(int, input().split())
if A > B:
    A, B = B, A

count = 0
for i in range(A, B+1):
    if i % X == 0:
        count += 1

print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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)

Submission status: Time Limit Exceeded

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

li = [i for i in range(a,b+1)]

count =0 
for j in range(len(li)):
    if(li[j]%x==0):
        count+=1
print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys
import copy

fline = input().rstrip().split(' ')
a, b, x = int(fline[0]), int(fline[1]), int(fline[2])

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a, b, x = map(int, input().split())
int_list = [i for i in range(a, b + 1)]
counter = 0
for i in range(len(int_list)):
    if int_list[i] % x == 0:
        counter += 1

print(counter)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

count = 0
i = 0
while x * i <= b:
    if x * i >= a:
        count += 1
    i += 1

print(count)

Submission status: Time Limit Exceeded

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

count = 0
for i in range(a, b+1):
    # print(i)  # debug
    if i % x == 0:  # 余りが0 = 割り切れる
        count += 1

print(count)

Submission status: Time Limit Exceeded

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

for i in range(b-x+1,b+1):
    if i % x == 0:
        maxi = i

for i in range(a-x,a):
    if i % x == 0:
        mini = i

print(maxi//x - mini//x)

Submission status: Time Limit Exceeded

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

cnt = 0

s = []
i = 0
while True:
    if x*i > b:
        break
    if x*i >= a and x*i <= b:
        s.append(x*i)
    i += 1

print(len(s))

Submission status: Time Limit Exceeded

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)

Submission status: Time Limit Exceeded

Solution code:
# Between a and b ...
a, b, x = map(int, input().split())
count = 0

for i in range(a, b+1):
    if i % x == 0:
        count = count +1
    else:
        pass
print(count)

Submission status: Time Limit Exceeded

Solution code:
# ABC48, B - between a and b
import itertools
a, b, x = [int(el) for el in input().split(' ')]

for i in itertools.count(a):
    if i % x == 0:
        A = i
        break

for i in itertools.count(b, -1):
    if i % x == 0:
        B = i
        break

print(B // x - A // x +1)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
a, b, x = map(int, input().split())
count1 = 0
count2 = 0
for i in range(0, a, x):
    count1 += 1

for i in range(0, b + 1, x):
    count2 += 1

print(count2 - count1)

Submission status: Time Limit Exceeded

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)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

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

print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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)

Submission status: Time Limit Exceeded

Solution code:
start,end,devide = map(int,input().split())
num = 0
for i in range(start,end + 1):
  if i % devide == 0:
    num +=1
    num += (end - i) // devide
    break
print(num)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def main():
    a, b, x = map(int, input().split())
    mod = [i for i in range(a, b + 1) if i % x == 0]
    print(len(mod))

if __name__ == "__main__":

    main()

Submission status: Time Limit Exceeded

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

ans = 0

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

print(ans)

Submission status: Time Limit Exceeded

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

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

c += (b-i) // x 
print(c)

Submission status: Time Limit Exceeded

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

count = 0
for n in range(a, b + 1):
    if n % x == 0:
        count = count + 1
        
print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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