Problem:


Score : 200 points

Problem Statement

Alice and Bob are controlling a robot. They each have one switch that controls the robot.

Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.

Bob started holding down his button C second after the start-up, and released his button D second after the start-up.

For how many seconds both Alice and Bob were holding down their buttons?

Constraints

0≤A<B≤100

0≤C<D≤100

All input values are integers.

Input

Input is given from Standard Input in the following format:  

A B C D

Output

Print the length of the duration (in seconds) in which both Alice and Bob were holding down their buttons.

Sample Input 1

0 75 25 100

Sample Output 1

50

Alice started holding down her button 0 second after the start-up of the robot, and released her button 75 second after the start-up.

Bob started holding down his button 25 second after the start-up, and released his button 100 second after the start-up.

Therefore, the time when both of them were holding down their buttons, is the 50 seconds from 25 seconds after the start-up to 75 seconds after the start-up.

Sample Input 2

0 33 66 99

Sample Output 2

0

Alice and Bob were not holding their buttons at the same time, so the answer is zero seconds.

Sample Input 3

10 90 20 80

Sample Output 3

60



Sample input:
0 75 25 100


Sample output:
50

Submission status: Runtime Error

Solution code:
def main():
    i = list(map(int, input().split()))
    a = i[0]
    b = i[1]
    c = i[2]
    d = i[3]

    if not (0 <= a and a < b and b <= 100 and 0 <= c and c < d and d <= 100):
        return

    alice = b - a
    bob = d -c

    if(b <= c or c < b):
        print(0)
    elif(c < b and b < d):
        print(b - c)
    elif(a < c and d < b):
        print(d - c)
    elif(a < d and d < b):
        print(d - a)
    elif(c < a and b < d):
        print(b - a)


if __name__ == "__main__":
    main(

Submission status: Runtime Error

Solution code:
a,b,c,d=int(input().split())
x=min(b,d)-max(a,c)
print(x if x>0 else 0)

Submission status: Runtime Error

Solution code:
A,B,C,D  =map(int,input().split())
AB = [str(i) for i in range(A,B+1)]
CD = [str(j) for j in range(C,D+1)]
count = 0

for a in range(101):
  if str(a) in AB and str(a) in CD:
    count += 1
if count = 0:
  print(0)
else:
  print(count-1)

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int.input().split())
print(max(0,min(b,d)-max(a,c)))

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int.input().split())
print(min(b,d)-(max(a,c))

Submission status: Runtime Error

Solution code:
a,b,c,d=int(open(0));print(max(0,min(b,d)-max(a,c)))

Submission status: Runtime Error

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

inter1 = [i for i in range(A,B + 1)]
inter2 = [i for i in range(C,D + 1)]

inter3 = []

for i in range(0,max(B,D)):
  if i in inter1 and i in inter2:
    inter3.append(i)
    
print(max(inter3) - min(inter3))

Submission status: Runtime Error

Solution code:
a = list(input().split())

if max(a[0],a[2]) < min(a[1],a[3]):
    print(int(min(a[1],a[3])-int(max(a[0],a[2])))
              
              
              
else if max(a[0],a[2]) >= min(a[1],a[3]):
    print(0)

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
print(max(b-c),0)

Submission status: Runtime Error

Solution code:
A,B,C,D = map(int,input().split())
if C<=A:
    if D>=B:
        print(B-A)
    elif A<=D:
        print(D-A)
    else:
        print(0)
elif C<=B:
    if D<=B:
        print(D-C)
    else:
        print(B-C)
    else:
        print(0)
else:
    print(0)

Submission status: Runtime Error

Solution code:
A, B, C, D = map(int, input().split())
ans = 0
for i in range(1, 101)
if A <= i and i <= B amd C <= i and i <= D:
  ans += 1
print(ans)

Submission status: Runtime Error

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

if a<c:
    if b>c:
        if b>d:
            answer=d-c
        else:
            answer=b-c
else:
    if d>a:
        if d>b:
            answer=b-aa
        else:
            answer=d-a
print(answer)

Submission status: Runtime Error

Solution code:
S = list(map(int,input().split()))
 
if S[0] =< S[1] =< S[2] =< S[3]:
    print (0)
    
elif S[0] =< S[2] =< S[3] =< S[1]:
    print(S[3]-S[2])
    
elif S[0] =< S[2] =< S[1] =< S[3]:
    print(S[1] - S[2])
    
elif S[2] =< S[0] =< S[3] =< S[1]:
    print(S[3] - S[0])
 
elif S[2] =< S[3] =< S[0] =< S[1]:
    print(0)

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int, (input().split))
if a < c and b < d:
    print(b-c)
elif c < a and b < d:
    print(b-a)
elif a < c and d < b:
    print(d-c)
elif c < a and d < b:
    print(d-a)
else:
    print(0)

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int, input().split)
if a < c and b < d:
    print(b-c)
elif c < a and b < d:
    print(b-a)
elif a < c and d < b:
    print(d-c)
elif c < a and d < b:
    print(d-a)
else:
    print(0)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())

if c>=b or d<=a:
    print(0)
else:
    if a<=c and b<=d:
        print(b-c)
    elif a<=c and b>d:
        print(d-c)
    elif a>c and b<=d:
        print(b-a)
    else:
        print(d-a)

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int,input().split())
if a<=c:
  if b-c>0
    print(b-c)
  else:
    print(0)
else:
  if d-a>0:
    print(d-a)
  else:
    print(0)

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
s=[]
for i in range(0,101):
  if a<=i<=b and c<=i<=d:
    s.append(i)
print(max(s)-min(s))

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int,input().split())
if b<c or d<a:
    print(0)
elif a<=c<d<=b:
    print(d-c)
elif a<c<b<d:
    print(b-c)
elif c<a<b<d:
    print(b-a)
elif:
    print(d-a)

Submission status: Runtime Error

Solution code:
n=[0]*101
a,b,c,d=map(int,input().split())
n[a]+=1
n[b+1]-=1
n[c]+=1
n[d+1]-=1
for i in range(100):
  n[i+1]+=n[i]
ans=0
for i in n:
  if i==2:
    ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
A, B, C, D = map(int, input())
s = max(A, C)
e = min(B, D)
span = max(0, e - s)
print(span)

Submission status: Runtime Error

Solution code:
A,B,C,D = list(map(int,input().split()))

if B <= C and D <= A:
    print(0)
else :
    ans_tmp1 = abs(B - C)
    ans_tmp2 = abs(D - C)
    if ans_tmp1 >= ans_tmp2:
        print(ans_tmp2)
    else:
        print(ans_tmp1))

Submission status: Runtime Error

Solution code:
def solve():
    a, b, c, d = read()
    result = think(a, b, c, d)
    write(result)


def read():
    return read_int(4)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def think(a, b, c, d):
    if b <= c or d <= a:
        return 0
    elif a <= c and d <= b:
        return d - c
    elif c <= a and b <= d:
        return b - a
    else:
        if a == c:
            return min(b, d) - a
        elif a < c:
            return abs(c - b)
        else:  # a > c
            return abs(d - a)


def write(result):
    print(result)


if __name__ == '__main__':
    solve()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
a, b, c, d = map(int, input().split())
if(c < b):
    if(d <= b):
        if(d <= a):
            time = 0
        else if(c < a):
            time = d - a
        else:
            time = d - c
    else:
        time = b - c
else:
    time = 0
print(time)

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
row = [0 for i in range(101)]
for i in range(a, b+1) : row[i] += 1
for i in range(c, d+1) : row[i] += 1
if row.count(2) == 0 : print(0)
else : print(raw.count(2)-1)

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
row = [i for i in range(101)]
row[a-1:b] += 1
row[c-1:d] += 1
print(row.count(0))

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
if b>=c:
    printabs((min(b,d)-max(a,c)))
else :
    print(0)

Submission status: Runtime Error

Solution code:
A,B,C,D = map(int, input().split())
if C < B:
  if D < B:
    print(D-C)
  else:
	print(B-C)
else:
  print(0)

Submission status: Runtime Error

Solution code:

if b <= c:
    print("0")
elif c <= a:
    print("0")



if a<c and (c<b and b<d):
    print(b-c)
elif (a<c and a<d) and (c<b and d<b):
    print(d-c)
elif (c<a and a<d) and (c<b and b<d):
    print(b-a)
elif (c<a and a<d) and (c<b and d<b):
    print(d-a)
else:
    print("0")

Submission status: Runtime Error

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



if b<c:
    print("0")
elif a<c and (c<b and b<d):
    print(b-c)
elif (a<c and c<n) and (a<d and d<b):
    print(d-c)
elif (c<a and a<d) and (c<b and b<d):
    print(b-a)
elif (c<a and a<d) and (c<b and d<b):
    print(d-a)
elif d<a:
    print("0")

Submission status: Runtime Error

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


if b < c:
    print("0")
    exit()

if c<b and b<d:
    print((d-c)-(d-b))
elif a<c adn d<b:
    print(d-c)
else:
    print("0")

Submission status: Runtime Error

Solution code:
a,b,c,d = list(map(int,input().split()))
if c<=a<=d<=b:
    print(d-a)
elif c<=a<=b<=d:
    print(b-a)
elif a<=c<=d<=b:
    pirnt(d-c)
elif a<=c<=b<=d:
    print(b-c)
else:
    print(0)

Submission status: Runtime Error

Solution code:
a,b,c,d = list(map(int,input().split()))
if c<a<d<b:
    print(d-a)
elif c<a<b<d:
    print(b-a)
elif a<c<d<b:
    pirnt(d-c)
elif a<c<b<d:
    print(b-c)
else:
    print(0)

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 1
while n >= 2:
    n = n // 2
    ans *= 2
print(ans)

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int, input())
if b < c or d < a:
    ans = 0
else:
    ans = min(abs(c-b), abs(d-a))
print(ans)

Submission status: Runtime Error

Solution code:
0 33 66 99

Submission status: Runtime Error

Solution code:
ABCD = list(map(int,input().split()))
if ABCD[1]<=ABCD[]2 or ABCD[3]<=ABCD[0]:
  print(0)
else:
  ABCD.sort()
  print(ABCD[2]- ABCD[1])

Submission status: Runtime Error

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

if B > C and C < D: # normal
  print(B-C)
elif B > C and B > D:
  print(D-C)
elif:
  print(0)
  
#elif B < C:
#  print(0)

Submission status: Runtime Error

Solution code:


def read_input():
    a, b, c, d = map(int, input().split())

    return a, b, c, d

def submit():
    a, b, c, d = read_input()

    if b < c or d < a:
        print(0)
        return

    if a < c:
        if d <= b:
            print(d - c)
        else:
            print(b - c)
    else:
        if b <= d:
            print(b - a)
        else:
            print(d - a)



if __name__ == '__main__':
    sub

Submission status: Runtime Error

Solution code:
A, B, C, D = (int(x) for x in input().split())
ans = min(B, D) - max(A - C)
if ans < 0:
    ans = 0
print(ans)

Submission status: Runtime Error

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


if b<=c:
    print ('0')
    exit()
elif:
    if b>=d:
        print(d-c)
        exit()
    elif b<d:
        print(b-c)
        exit()

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
c,d=map(int,input().split())
if b>c:
    print(b-c)
elese:print("0")

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input())
if a<=c<=b:
  if b<d:
    print(b-c)
  else:
    print(d-c)
elif c<=a<=d:
  if b<d:
    print(b-a)
  else:
    print(d-a)
else:
  print(0)

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input())
if a<=c<=b:
  if b<d:
    print(b-c)
  else:
    print(d-c):
elif c<=a<=d:
  if b<d:
    print(b-a)
  else:
    print(d-a):  
else:
  print(0)

Submission status: Runtime Error

Solution code:
A, B, C, D = map(int, input().split())
if(A<C):
  print(max(0, B-D))
if(A>C):
  print(max(0, D-B))
if(A=C):
  print(min(B-A, D-A))

Submission status: Runtime Error

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

if A <= C:
    print(max(min(B, D) - C), 0)
else:
    print(max(min(B, D) - A), 0)

Submission status: Runtime Error

Solution code:
a1,a2,b1,b2=map(int,input().split())
print(max(min(a2,b2)-max(b1,a1),0)

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int, input().split())
if b <= c or d <= a:
    print(0)
else:
    if
    print(min(b,d)-max(a,c))

Submission status: Runtime Error

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

print(max(min(b,d)-(max(a,c), 0))

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int, input().split())
print(max(0,min(b,d)-max(a,c))

Submission status: Runtime Error

Solution code:
A,B,C,D=map(int,input().split())
if A <= C and C <= B and B <= D:
  print(B-C)
elif C <= A and A <= B and B <= D:
  print(B-A)
elif A <= B and B <= C and C <= D:
  print(0)
elif C <= A and A <= D and D <= B:
  print(D-A)
elif A <= C and C <= D and D <= B:
  print(D-C)
else C <= D and D <= A and A <= B:
  print(0)

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
Alice=range(a,b+1)
Bob=range(c,d+1)
Alice_Bob=set(Alice)+set(Bob)
print(len(Alice_Bob))

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
print(max(min(b,d)-max(a,c)),0)

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int, input().split())
if a > c:
    a,b,c,d = c,d,a,b
if b < c:print(0)
elif b => c and b < d:print(b-c)
else : print(d-c)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
A,B,C,D = map(int,input().split())
L = [A:B]
M = [C:D]
print(L&M)

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int, input().split())
if c >= b or a >= d:
    print(0)
else:
    if a <= c:
        print(min(b-c,d-c))
    else:
        print(min(d-a,b-a)

Submission status: Runtime Error

Solution code:
def abc070_b():
    a, b, c, d = map(int, input().split())
    
    if c > b:
        return 0
    
    if c < a < b < d:
        return b - a
    
    if a < c < b < d:
        return b - c
    
    if a < c < d < b:
        return d - c
    
    
if __name__ == '__main__':
    print(abc048_b())

Submission status: Runtime Error

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

if b<=c:
    print(0)
elif a<=c and b<=d:
    print(b-c)
elif a<=c and d<=b:
    print(d-c)
elif c<=a and b<=d:
    print(b-a)
elif c<=a and d<=b:
    print(d-a)
elif d<=a
    print(0)

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int,input().split())
if c < b < d:
  print(b-C)
elif a < d < b:
  print(d-a)
elif a < c < b and a< d < b:
  print(d-c)
elif c < a < d and c < b < d:
  print(b-a)
else:
  print(int(0))

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int,input().split())
if c < b < d:
  print(b-C)
elif a < d < b:
  print(d-a)
elif a < c < b and a< d < b:
  print(d-c)
elif c < a < d and c < b < d:
  print(b-a)
else:
  print(0)

Submission status: Runtime Error

Solution code:
a,b,c,d = inpl()
print(max(0,(min(b,d)-max(a,c))))

Submission status: Runtime Error

Solution code:
a,b,c,d=map((int,input().split()))
start=min(a,b)
end=min(c,d)
print(end-start if end-start > 0 else 0)

Submission status: Runtime Error

Solution code:
A, B, C, D = input().split(' ')
A, B, C, D = int(A), int(B), int(C), int(D)
 
print(min(min(D, B) - max(C, A), 0)

Submission status: Runtime Error

Solution code:
A, B, C, D = input().split(' ')
A, B, C, D = int(A), int(B), int(C), int(D)
 
print(max(min(D, B) - max(C, A), 0)

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int,input().split())
print(max(min(b,d)-max(a,c),0)

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int,input().split())
print(max(min(b,d)-max(a,c)),0)

Submission status: Runtime Error

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

if B<C:
    res = 0
else:
    res = min(B,D) - max(A<C)
print(res)

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int,input())
print(min(b,d)-max(a,c))

Submission status: Runtime Error

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

ans = (b - c) < 0 ? 0 : b - c

print(ans)

Submission status: Runtime Error

Solution code:
 a, b, c, d = raw_input().split(' ')
 time = int(min(b, d)) - int(max(a, c))
 print(time if time else 0)

Submission status: Runtime Error

Solution code:
a, b, c, d = input().split(' ')
time = min(b, d) - max(a, c)
print(time if time else 0)

Submission status: Runtime Error

Solution code:
 a, b, c, d = input().split(' ')
 time = int(min(b, d)) - int(max(a, c))
 print(time if time else 0)

Submission status: Runtime Error

Solution code:
list = input().split()
a = list[0]
b = list[1]
c = list[2]
d = list[3]
result = 0
if a < b and c < d:
    if (a >= c and b <= d) or (a <= c and b >= d):
        result = min(b-a,d-c)
    elif a <= c and c <= b:
        result = b - c
    elif c <= a and a <= d:
        result =  d - a
print(result)

Submission status: Runtime Error

Solution code:
A, B, C, D = input().split()
value = (min(B, D) - max(A, C))
print(value if value > 0 else "0")

Submission status: Runtime Error

Solution code:
A, B, C, D = map(int, input().split())
res = list(set(range(A, B+1)) & set(range(C, D+1)))
print(res[-1] - res[0])

Submission status: Runtime Error

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

if a <= c:
    if b <= c:
        print(b-c)
    else:
        print(d - c)
elif c <= a:
     if c <= b:
        print(c - b)
    else:
        print(b - c)
else:
    print(0)

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
    A, B, C, D = map(int, input().split())

    if B <= C or D <= A:
        print(0)
    else:
        if A < C:
            print(B-C)
        elif A > C
            print(D - A)
        else:
            if B < D:
                print(B-A)
            else:
                print(D-A)

Submission status: Runtime Error

Solution code:
if __name == '__main__':
    A, B, C, D = map(int, input().split())

    if B =< C or D =< A:
        print(0)
    else:
        if A < C:
            print(B-C)
        else:
            print(D - A)

Submission status: Runtime Error

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

A, B, C, D = [for i in s]

if D <= A or C >= B:
  print("0")
elif C <= A and D >= B:
  print(B - A)
elif C >= A and D >= B:
  print(B - C)
elif D <= B and C <= A:
  print(D - A)

Submission status: Runtime Error

Solution code:
map(int, input().split())

if(b<=c):
    print(0)
else:
    z=b-c
    print(z)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())

if(b<=c):
    print(0)
else:
    z=b-c
    print(z)

Submission status: Runtime Error

Solution code:
A,B,C,D=int(input().split())
x=min(C,D)-max(A,B)
if x>0:
    print(x)
else:
    print("0")

Submission status: Runtime Error

Solution code:
i=input()
l=map(int,input().split())
ans=min(l[1],l[3])-max(l[0],l[2])
print(ans if ans>0 else 0)

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
print(max(0,min(a,c)-max(b,d))

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int(),input().split())
print(max(0,min(a,c)-max(b,d))

Submission status: Runtime Error

Solution code:
a=input()
b=input()
c=input()
d=input()
fast=max(int(a),int(c))
last=min(int(b),int(d))
print(max(0,int(last-fast)))

Submission status: Runtime Error

Solution code:
a=input()
b=input()
c=input()
d=input()

fast=max(int(a),int(c))
last=min(int(b),int(d))

print(max(0,int(last-fast)))

Submission status: Runtime Error

Solution code:
a=input()
b=input()
c=input()
d=input()
if a<c:
    fast=c
else:
    fast=a
if b<d:
    last=b
else:
    last=d

if b<c:
    print("0")
else:
    print(str(last-fast))

Submission status: Runtime Error

Solution code:
#include<iostream>
using namespace std;

int main(void){
    int A,B,C,D;
    cin >> A >> B >> C >> D;
    const int lower = max(A,C);
    const int upper = min(B,D);
    
    cout << max(0,upper-lower) << endl;
    
    return 0;
}

Submission status: Runtime Error

Solution code:
def gcd(a,b):
    return b





def lcm(a,b):
    return a


n=int(input())
t=[int(input()) for lop in range(n)]
ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t)
print(int(ans))

Submission status: Runtime Error

Solution code:
def gcd(a,b):
    if a<b:
        c=a;
        a=b;
        b=c;
    c=a%b

    if c==0:
        return b
    else:
        return gcd(b,c)




def lcm(a,b):
    c=gcd(a,b);
    return a/c*b


n=int(input())
t=[int(input()) for lop in range(n)]
ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t)
print(int(ans))

Submission status: Runtime Error

Solution code:
A=input().strip().sprit(' ')
B=input().strip().sprit(' ')
C=input().strip().sprit(' ')
D=input().strip().sprit(' ')
a=int(A)
b=int(B)
c=int(C)
d=int(D)

max=0
min=0

if a < c :
    max=c
else :
    max=a
    
if b > d :
    min=d
else :
    min=b
if ( min - max ) > 0 :
    print( min - max )
else :
    print(0)

Submission status: Runtime Error

Solution code:


A=input().strip()
B=input().strip()
C=input().strip()
D=input().strip()
a=int(A)
b=int(B)
c=int(C)
d=int(D)

max=0
min=0

if a < c :
    max=c
else :
    max=a
    
if b > d :
    min=d
else :
    min=b
if ( min - max ) > 0 :
    print( min - max )
else :
    print(0)

Submission status: Runtime Error

Solution code:
A=input()
B=input()
C=input()
D=input()
a=int(A)
b=int(B)
c=int(C)
d=int(D)

print(0)

Submission status: Runtime Error

Solution code:
A=input()
B=input()
C=input()
D=input()
a=int(A)
b=int(B)
c=int(C)
d=int(D)

max=0
min=0

if a < c :
    max=c
else :
    max=a
    
if b > d :
    min=d
else :
    min=b
if ( min - max ) > 0 :
    print( min - max )
else :
    print(0)

Submission status: Runtime Error

Solution code:
nput()
B=input()
C=input()
D=input()
a=int(A)
b=int(B)
c=int(C)
d=int(D)

max=0
min=0

if a < c :
    max=c
else :
    max=a
    
if b > d :
    min=d
else :
    min=b
if ( min - max ) > 0 :
    print( min - max )
else :
    print(0)

Submission status: Runtime Error

Solution code:
A=input()
B=input()
C=input()
D=input()
a=int(A)
b=int(B)
c=int(C)
d=int(D)

max=0
min=0

if a < c :
    max=c
else :
    max=a
    
if b > d :
    min=d
else :
    min=b
if ( min - max ) > 0 :
    print( min - max )
    print('\n')
else :
    print('0\n')
quit()

Submission status: Runtime Error

Solution code:
A=input()
B=input()
C=input()
D=input()
a=int(A)
b=int(B)
c=int(C)
d=int(D)

if a < c :
    max=c
else :
    max=a
    
if b > d :
    min=d
else :
    min=b
if ( min - max ) > 0 :
    print( min - max )
    print('\n')
else :
    print('0\n')

Submission status: Runtime Error

Solution code:
A=input()
B=input()
C=input()
D=input()
a=int(A)
b=int(B)
c=int(C)
d=int(D)

if a < c :
    max=c
else :
    max=a
    
if b > d :
    min=d
else :
    min=b
if ( min - max ) > 0 :
    print( min - max )
    print('\n')
else :
    print('0\n')
quit()

Submission status: Runtime Error

Solution code:
A=input()
B=input()
C=input()
D=input()
a=int(A)
b=int(B)
c=int(C)
d=int(D)
if a<c:
    max=c
else:
    max=a
if b>d:
    min=d
else:
    min=b
if (min-max)>0:
    print(min-max)
    print('\n')
else:
    print('0\n')
quit()

Submission status: Runtime Error

Solution code:
A=input()
B=input()
C=input()
D=input()
a=int(A)
b=int(B)
c=int(C)
d=int(D)
if a<c:
    max=c
else:
    max=a
if b>d:
    min=d;
else:
    min=b
if (min-max)>0:
    print(min-max)
    print('\n')
else:
    print('0\n')
quit()

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split());print(max(0,min(c,d)-max(a,b))

Submission status: Runtime Error

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

if(B < C or D < A):
	print(0)

else:
	if(A > C):
		E = A
	else:
		E = C

	if(B > D):
		F = D
	else:
		F = B

print(F - E)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define  rep(i,n) for(li i=0;i<(n);i++)
#define  red(i,n) for(li i=(n)-1;i>=0;i--)
#define  all(a)   begin(a),end(a)
#define  pb(a)    push_back(a) 
using namespace std;
using li = long long;
using vi = vector<li>;
using vs = vector<string>;


int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<max(0,min(b,d)-max(a,c))<<endl;

    return 0;
}

Submission status: Runtime Error

Solution code:
import math

def lcm(x, y):
    return ((x * y) // math.gcd(x, y))

n = int(input())
t = [i for i in range(n)]
for i in range(n):
    t[i] = int(input())

ans = 1
for i in range(0, n):
    ans = lcm(ans, t[i])

print(int(ans))

Submission status: Runtime Error

Solution code:
ls = list(map(int, input().split()))
A = ls[0]
B = ls[1]
C = ls[2]
D = ls[3]

k = [ i for i in range(0,101) if A <= i <= B and C <= i <= D]
print(max(k) - min(k))

Submission status: Runtime Error

Solution code:
a=input()
b=input()
c=input()
d=input()

print(c-b-a)

Submission status: Runtime Error

Solution code:
A, B, C, D = input().split()
A = int(A)
B = int(B)
C = int(C)
D = int(D)


def solve(A, B, C, D):
    if A < C:
        if B < C:
            print("0")
        elif A <= C and D <= B:
            print(str(D-C))
        else:
            ptint(str(B-C))
    else:
        if D < A:
            print("0")
        elif C <= A and B <= D:
            print(str(B-A))
        else:
            print(str(D-A))

solve(A, B, C, D)

Submission status: Runtime Error

Solution code:
A, B, C, D = input().split()
A = int(A)
B = int(B)
C = int(C)
D = int(D)

if A < C:
    if B < C:
        print(0)
    elif A <= C and D <= B:
        print(D-C)
    else:
        ptint(B-C)
else:
    if D < A:
        print(0)
    elif C <= A and B <= D:
        print(B-A)
    else:
        print(D-A)

Submission status: Runtime Error

Solution code:
A, B, C, D = input().split()
A = int(A)
B = int(B)
C = int(C)
D = int(D)

if A < C:
    if B < C:
        print(0)
    elif A <= C and D <= B:
        print(D-C)
    else:
        ptint(B-C)
else:
    if D < A:
        print(0)
    elif C <= A and N <= D:
        print(B-A)
    else:
        print(D-A)

Submission status: Runtime Error

Solution code:
def gcd(a,b):
    if a==0:
        return b
    return gcd(b%a,a)

n=int(input())
arr=[]
for i in range(0,n):
    x=int(input())
    arr.append(x)

ans=int(0)
if n>1:
    ans=arr[0]*arr[1]/gcd(arr[0],arr[1])
    for i in range(2,n):
        ans=ans*arr[i]/gcd(ans,arr[i])

print(int(ans))

Submission status: Runtime Error

Solution code:
# coding: utf-8

a, b, c, d = map(int, input().split())
alice_time = [x for x in range(a, b+1)]
bob_time = [x for x in range(c, d+1)]
pushed_time = set(alice_time) & set(bob_time)

if len(pushed_time) == 0:
  print(0)
else:
  print(pushed_time - 1)

Submission status: Runtime Error

Solution code:
# coding: utf-8

a, b, c, d = map(int, input().split())
alice_time = [x for x in range(a, b+1)]
bob_time = [x for x in range(c, d+1)]
pushed_time = set(alice_time) & set(bob_time)

if len(pushed_time) == 0:
	print(0)
else:
	print(pushed_time - 1)

Submission status: Runtime Error

Solution code:
A,B,C,D = list(map(int,input().split()))


if A < C:
  a = C
else:
  a = A

if B < D:
  b = B
else:
  b = D
  
if B =< C or D =< A:
  res = 0
else:
  res = (b-a)
  
print(res)

Submission status: Runtime Error

Solution code:
# coding: utf-8

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

alice_time = range(a, b+1)
bob_time = range(c, d+1)
pushed_time = set(alice_time) & set(bob_time)

print(alice_time)
print(bob_time)

if not pushed_time:
  print (pushed_time[0] - pushed_time[-1])

Submission status: Runtime Error

Solution code:
# coding: utf-8

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

alice_time = range(a, b+1)
bob_time = range(c, d+1)
pushed_time = set(alice_time) & set(bob_time)

print(alice_time)
print(bob_time)

if not pushed_time:
	print (pushed_time[0] - pushed_time[-1])

Submission status: Runtime Error

Solution code:
a[]=list(map(int,input().split()))
n=min(a[1],a[3])-max(a[0],a[2])
print(n if n>0 else 0)

Submission status: Runtime Error

Solution code:
# coding: utf-8

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

if c <= b:
	if c <= d:
	  print(b - c)
	 else:
	 	print(d - c)
else:
	print(0)

Submission status: Runtime Error

Solution code:
#include <iostream>

using namespace std;

int main() {
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    int ans = 0;
    for(int i = 0; i <= 100; ++i)
        if(i >= a and i <= b and i >= c and i <= d)
            ++ans;
    if(ans > 0)
        --ans;
    cout << ans << endl;
    return 0;
}

Submission status: Runtime Error

Solution code:
a,b,c,d = input().split(" ")
init = max(a,c)
term = min(b,d)
if term-init <= 0 and :
  print "0"
else:
  print (term-init)

Submission status: Runtime Error

Solution code:
A,B,C,D = [int(i) for i in input().split()]
print(min(0,min(B,D) - max(A,C))

Submission status: Runtime Error

Solution code:
a,b,c,d = input()
init = max(a,c)
term = min(b,d)
if term-init <= 0:
  print "0"
else:
  print (term-init)

Submission status: Runtime Error

Solution code:
a,b,c,d = input()
init = max(a,c)
term = min(b,d)
if term-init <= 0 and :
  print "0"
else:
  print (term-init)