Problem:


Score : 100 points

Problem Statement

In this problem, we use the 24-hour clock.

Takahashi gets up exactly at the time H_1 : M_1 and goes to bed exactly at the time H_2 : M_2. (See Sample Inputs below for clarity.)
He has decided to study for K consecutive minutes while he is up.
What is the length of the period in which he can start studying?

Constraints

0 \le H_1, H_2 \le 23

0 \le M_1, M_2 \le 59

The time H_1 : M_1 comes before the time H_2 : M_2.

K \ge 1

Takahashi is up for at least K minutes.

All values in input are integers (without leading zeros).

Input

Input is given from Standard Input in the following format:

H_1 M_1 H_2 M_2 K

Output

Print the length of the period in which he can start studying, as an integer.

Sample Input 1

10 0 15 0 30

Sample Output 1

270

Takahashi gets up at exactly ten in the morning and goes to bed at exactly three in the afternoon.
It takes 30 minutes to do the study, so he can start it in the period between ten o'clock and half-past two. The length of this period is 270 minutes, so we should print 270.

Sample Input 2

10 0 12 0 120

Sample Output 2

0

Takahashi gets up at exactly ten in the morning and goes to bed at exactly noon. It takes 120 minutes to do the study, so he has to start it at exactly ten o'clock. Thus, we should print 0.



Sample input:
10 0 15 0 30


Sample output:
270

Submission status: Runtime Error

Solution code:
wake_up_hour= int(input("Enter WakeUp Hour: "))
wake_up_minute=int(input("Enter WakeUp Minute: "))
sleep_hour=int(input("Enter Sleep Hour: "))
sleep_minute= int(input("Enter Sleep Minute:" ))
study_time=int(input("Study time :"))

#print(wake_up_hour, wake_up_minute, sleep_hour, sleep_minute, study_time)
Total_Minutes = (sleep_hour) *60 + (sleep_minute) - ((wake_up_hour) * 60 + (wake_up_minute))
if Total_Minutes > study_time:
    print("You can finish the study")
    start_before_minute= ((sleep_hour*60 +  sleep_minute) - study_time) % 60
    start_before_hour= ((sleep_hour*60 +  sleep_minute) - study_time) // 60 
    print("Start before: ", start_before_hour, start_before_minute, )
else:
    print("You are lazy!!!. wake up early")

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
    N = int(input().strip())
    A = list(map(int, input().strip().split(" ")))


    if A[0] != 1 and len(A) == 1:
        print(-1)

    tree = [0] * (sum([2 ** i for i in range(N + 1)]))
    for i, a in enumerate(A[::-1]):
        depth = len(A) - 1 - i
        depth_hierarchy_start_index = sum([2 ** i for i in range(depth)]) if depth != 0 else 0
        depth_hierarchy_end_index = sum([2 ** i for i in range(depth + 1)]) if depth != 0 else 1

        # keisho
        if depth != N:
            for i in range(depth_hierarchy_start_index, depth_hierarchy_end_index):
                if tree[2 * i + 1] != 0 or tree[2 * i + 2] != 0:
                    tree[i] = 2

        # 1 ume
        count = 0
        part = 2
        while True:
            try:
                for i in range(0, 2 ** depth, int(2 ** depth / part) if int(2 ** depth / part) != 0 else 1):
                    if tree[depth_hierarchy_start_index + i] == 0:
                        tree[depth_hierarchy_start_index + i] = 1
                        count += 1
                    if count == a:
                        break
                    part *= 2
                if count == a:
                    break
            except:
                print(-1)

    print(sum([1 if i != 0 else 0 for i in tree]))

Submission status: Runtime Error

Solution code:
# coding:utf-8
import readline
h1 = input()
m1 = input()
h2 = input()
m2 = input()
k = input()

Submission status: Runtime Error

Solution code:
h1 = input()
m1 = input()
h2 = input()
m2 = input()
k = input()

Submission status: Runtime Error

Solution code:
H1 = raw_input()
M1 = raw_input()
H2 = raw_input()
M2 = raw_input()
K = raw_input()

Submission status: Runtime Error

Solution code:
H1,H2,M1,M2,K=int(input()) 
print(60*(H2-H1)+M2-M1-K)

Submission status: Runtime Error

Solution code:
H1 = input()
M1 = input()
H2 = input()
M2 = input()
K = input()

Submission status: Runtime Error

Solution code:
H1 = int(raw_input())
M1 = int(raw_input())
H2 = int(raw_input())
M2 = int(raw_input())
K = int(raw_input())

Submission status: Runtime Error

Solution code:
H1,H2,M1,M2,K=int(input()) 
print(60*(H2-H1)+M2-M1-K)

Submission status: Runtime Error

Solution code:
t = list(map(int, input()))
one = t.count(1)
print(one*(one+1)//2-2)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
bottom = sum(A)

ret = 1
children = 1 - A[0]
bottom -= A[0]

for i in range(N):
    children = children * 2 - A[i+1]
    if children <= -1:
      ret = -1
      break
    
    bottom -= A[i+1]
    if children >= bottom:
      children = bottom
    ret += children + A[i+1]
print(ret)

Submission status: Runtime Error

Solution code:
H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

Submission status: Runtime Error

Solution code:
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())


# while not 0 <= H1 < 23 and 0 <= M1 < 59 and 0 <= H2 < 23 and 0 <= M2 < 59:
#     H1 = int(raw_input())
#     M1 = int(raw_input())
#     H2 = int(raw_input())
#     M2 = int(raw_input())
#     K = int(raw_input())
    
if M2 > M1:
    a = (H2 - H1) * 60 + M2 - M1
    print(a - K)
if M2 < M1:
    b = (H2 - H1) * 60 + M1 - M2
    print(b - K)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
c,d=map(int,input().split())
K=int(input()) 
print(60*(b-a)+d-c-K)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
bottom = sum(A)

ret = 1
children = 1 - A[0]
bottom -= A[0]

for i in range(N):
    children = children * 2 - A[i+1]
    if children <= 0:
      ret = -1
      break
    
    bottom -= A[i+1]
    if children >= bottom:
      children = bottom
    ret += children + A[i+1]
print(ret)

Submission status: Runtime Error

Solution code:
from sys import stdin, stdout
n = int(stdin.readline())
nmleaves = list(map(int, stdin.readline().strip().split()))

# pref[i]: sum of all elements in nmleaves after i, i.e. sum(nmleaves[i+1:])
full = sum(nmleaves)
tot = 0
pref = [0]*(n+1)
for i, l in enumerate(nmleaves):
    tot += l
    pref[i] = full - tot

if n==0:
    print(0)

else:
    if nmleaves[0]!=0:
        print(-1)
        exit()
    
    ## it exists
    ans = 0
    for level, leaves in enumerate(nmleaves):
        if leaves > 2**(level):
            print(-1)
            exit()

        if level == 0:
            ans += 1
            validnom = 1
        else:
            maxup = 2*validnom
            maxnom = maxup - leaves

            if level+1<len(nmleaves):
                validnom = min(maxnom, pref[level])
                ans += (leaves + validnom)
            else:
                ans += leaves
    print(ans)

Submission status: Runtime Error

Solution code:
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while not 0 <= H1 < 23 and 0 <= M1 < 59 and 0 <= H2 < 23 and 0 <= M2 < 59:
	H1 = int(input())
	M1 = int(input())
	H2 = int(input())
	M2 = int(input())
	K = int(input())
if M2 > M1:
    a = (H2 - H1) * 60 + M2 - M1
    print(a - K)
if M2 < M1:
    b = (H2 - H1) * 60 + M1 - M2
    print(b - K)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
input_nums = input().split()

diff_hour = input_nums(2) - input_nums(0)
diff_hour_to_min = diff_hour * 60

diff_min = input_nums(3) - input_nums(1)

total_wake_min = diff_hour_to_min + diff_min

print(total_wake_min - input_nums(4))

Submission status: Runtime Error

Solution code:
import sys
import math
import itertools
import collections
import heapq
import numpy as np

rl = sys.stdin.readline

h1, m1, h2, m2, k = map(int, rl().split())
m = h260 + m2 - h160 - m1
print(m-k)

Submission status: Runtime Error

Solution code:
h1, m1, h2, m2, k = map(int, input().split())

H = (h2-h1)*60
M = abs(m1-m2)
if H-M-k >= 0:
print(H-M-k)

Submission status: Runtime Error

Solution code:
wake_up_hour= int(input("Enter WakeUp Hour: "))
wake_up_minute=int(input("Enter WakeUp Minute: "))
sleep_hour=int(input("Enter Sleep Hour: "))
sleep_minute= int(input("Enter Sleep Minute:" ))
study_time=int(input("Study time :"))

Total_Minutes = (sleep_hour) *60 + (sleep_minute) - ((wake_up_hour) * 60 + (wake_up_minute))
if Total_Minutes > study_time:
    print("You can finish the study")
    start_before_minute= ((sleep_hour*60 +  sleep_minute) - study_time) % 60
    start_before_hour= ((sleep_hour*60 +  sleep_minute) - study_time) // 60 
    print("Start before: ", start_before_hour, start_before_minute, )
else:
    print("You are lazy!!!. wake up early")

Submission status: Runtime Error

Solution code:
H1,H2=map(int,input().split())
M1,M2=map(int,input().split())
K=int(input()) 
print(60*(H2-H1)+M2-M1-K)

Submission status: Runtime Error

Solution code:
h1=int(input())
m1=int(input())
h2=int(input())
m2=int(input())
k=int(input())

ans=0
if m1>m2: ans=(h2-h1-1)*60+60-m1+m2
else: ans=(h2-h1)*60+m2-m1
print(ans-k)

Submission status: Runtime Error

Solution code:
def main(N, A):
    num = 1
    ans = 1
    for i in range(N+1):
        num -= A[i]
        if i < N:
            num *= 2
            ans += num
        if num <= 0 and i < N:
            return -1
    eda = 0
    for i in range(N+1):
        ans -= num
        eda += A[N-i]
        num -= eda
        num = num//2
        if num <= 0:

            break
    return ans


N = int(input())
A = list(map(int, input().split()))

print(main(N, A))

Submission status: Runtime Error

Solution code:
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while not 0 <= H1 < 23 and 0 <= M1 < 59 and 0 <= H2 < 23 and 0 <= M2 < 59:
	H1 = int(input())
	M1 = int(input())
	H2 = int(input())
	M2 = int(input())
	K = int(input())
else:
    if M2 > M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
    else:
        M2 < M1
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)

Submission status: Runtime Error

Solution code:
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while not 0 <= H1 < 23 and 0 <= M1 < 60 and 0 <= H2 < 23 and 0 <= M2 < 60:
	H1 = int(input())
	M1 = int(input())
	H2 = int(input())
	M2 = int(input())
	K = int(input())
else:
    if M2 > M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
    else:
        M2 < M1
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)

Submission status: Runtime Error

Solution code:
wake_up_hour= int(input("Enter WakeUp Hour: "))
wake_up_minute=int(input("Enter WakeUp Minute: "))
sleep_hour=int(input("Enter Sleep Hour: "))
sleep_minute= int(input("Enter Sleep Minute:" ))
study_time=int(input("Study time :"))

print(wake_up_hour, wake_up_minute, sleep_hour, sleep_minute, study_time)
Total_Minutes = (sleep_hour) *60 + (sleep_minute) - ((wake_up_hour) * 60 + (wake_up_minute))

print(Total_Minutes)

if Total_Minutes > study_time:
    print("You can finish the study")
    start_before_minute= ((sleep_hour*60 +  sleep_minute) - study_time) % 60
    start_before_hour= ((sleep_hour*60 +  sleep_minute) - study_time) // 60 
    print("Start before: ", start_before_hour, start_before_minute, )
else:
    print("You are lazy!!!. wake up early")

Submission status: Runtime Error

Solution code:
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while 0 <= H1 < 23 and 0 <= M1 < 60 and 0 <= H2 < 23 and 0 <= M2 < 60:
    if M2 > M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
        break
    else:
        M2 < M1
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)
        break
else:
	H1 = int(input())
	M1 = int(input())
	H2 = int(input())
	M2 = int(input())
	K = int(input())

Submission status: Runtime Error

Solution code:
h1 = int(input())
m1 = int(input())
h2 = int(input())
m2 = int(input())
k = int(input())
print(m2-m1+(h2-h1)*60-k)

Submission status: Runtime Error

Solution code:
okiji,okihun,neji,nehun,benji=map(int,input().split())
    print((neji*60+nehun)-(okiji*60+okihun)-benji)

Submission status: Runtime Error

Solution code:
1,m1,h2,m2,k =(int(x) for x in input().split())  
 
hrtom= (h2-h1)
 
if (m2-m1 < 0) and (h2-h1 >=0) : 
    min = (h2-h1)*60 - (m2-m1) - k
    print(min)
    
elif (m2-m1 >= 0) and (h2-h1 >=0 ):
    min = (h2-h1)*60 + (m2-m1) - k 
    print(min)

elif (m2-m1 < 0) and (h2-h1) <=0 :
    min = (24-h1+h2)*60 - (m2-m1) -k 
    print(min) 
    
elif (m2-m1 >= 0) and (h2-h1) <=0 :
    min = (24-h1+h2)*60 + (m2-m1) -k 
    print(min) 
    
else:
    print('0')

Submission status: Runtime Error

Solution code:
h1 = int(input())
m1 = int(input())
h2 = int(input())
m2 = int(input())
K = int(input())
print(m2 + h2*60 - m1 - h1*60 - K)

Submission status: Runtime Error

Solution code:
H2-H1=H3
M2-M1=M3
H3*60+M3=x
x-K

Submission status: Runtime Error

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

import sys
sys.setrecursionlimit(300000)


def solve(N: int, A: "List[int]"):
    cur = 1
    ret = 0
    t = []
    for i in range(N):
        v = A[i]
        if v >= cur:
            print(-1)
            return
        t.append(cur)
        ret += cur
        #print(i, cur, ret)
        cur = (cur - v) * 2
    if A[-1] > cur:
        print(-1)
        return
    ret += A[-1]
    #print(ret)

    mx = A[-1]
    for i in range(1, N)[::-1]:
        tmp = min(mx + A[i], 2 ** i)
        if t[i] > tmp:
            ret -= t[i] - tmp
        #ret += tmp
        mx = min(tmp, 2 ** (i - 1))
    print(ret)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N - 0 + 1)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())
print((M2 + H2*60 - (M1 + H1*60)) - K)

Submission status: Runtime Error

Solution code:
H1,H2=map(int,input().split())
M1,M2=map(int,input().split())
K=int(input())
print(60*H2+M2-60*H2+M2-K)

Submission status: Runtime Error

Solution code:
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while 0 <= H1 < 23 and 0 <= M1 < 60 and 0 <= H2 < 23 and 0 <= M2 < 60:
    if M2 > M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
    else:
        M2 < M1
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)
else:
  	H1 = int(input())
	M1 = int(input())
	H2 = int(input())
	M2 = int(input())
	K = int(input())

Submission status: Runtime Error

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

h1, m1, h2, m2, k = input.split()

h_time = (h2 - h1 -1) * 60
m_time = (60 - m1) + m2

rest_time = (h_time + m_time) - k
print(rest_time)

Submission status: Runtime Error

Solution code:
import sys

args = sys.argv

H1 = (int)(args[1]);
M1 = (int)(args[2]);
H2 = (int)(args[3]);
M2 = (int)(args[4]);
K = (int)(args[5]);

wakeUpTime = H1 * 60 + M1
sleepTime = H2 * 60 + M2

studyTime = sleepTime - wakeUpTime - K;

print(studyTime)

Submission status: Runtime Error

Solution code:
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while 0 <= H1 < 23 or 0 <= M1 < 60 or 0 <= H2 < 23 or 0 <= M2 < 60:
    if M2 > M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
    else:
        M2 < M1
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)

Submission status: Runtime Error

Solution code:
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while H1 < 23 or M1 < 60 or H2 < 23 or M2 < 60:
  	H1 = int(input())
	M1 = int(input())
	H2 = int(input())
	M2 = int(input())
	K = int(input())
else:
    if M2 > M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
    else:
        M2 < M1
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)

Submission status: Runtime Error

Solution code:
L=list(map(int,input().split()))
if L[0] > L[2]:
	A=60*L[0]+L[1]
	B=60*(L[2]+24)+L[3]
else:
	A=60*L[0]+L[1]
	B=60*L[2]+L[3]

if B-A <= L[4]:
	print("0")
elif (B-A)%L[4]==0:
	print(str(((B-A)-L[4])))
else:
	print(str(round((B-A)//L[4])))z

Submission status: Runtime Error

Solution code:
H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while H1 > 23 or M1 > 60 or H2 > 23 or M2 > 60:
	H1 = int(input())
	M1 = int(input())
	H2 = int(input())
	M2 = int(input())
	K = int(input())
else:
    if M2 > M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
    else:
        M2 < M1
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)

Submission status: Runtime Error

Solution code:
H1,M1,H2,M2,K = map(int,input().split())
 
h = H2 - H1
m = M2 - M1
s = 0
if h > 0:
    s = h * 60 + m
elif: h == 0:
    s = 24 * 60 + m
else:
    s = (24 + h) * 60 + m

s -= K
print(s)

Submission status: Runtime Error

Solution code:
import readline
import datetime

get_time = int(input())
get_minute = int(input())
sleep_time = int(input())
sleep_minute = int(input())
study = int(input())

while get_time > 23 or get_minute > 60 or sleep_time > 23 or sleep_minute > 60:
  	get_time = int(input())
	get_minute = int(input())
	sleep_time = int(input())
	sleep_minute = int(input())
	study = int(input())
else:
    if sleep_minute > get_minute:
        a = (sleep_time - get_time) * 60 + sleep_minute - get_minute
        print(a - study)
    else:
        sleep_minute < get_minute
        b = (sleep_time - get_time) * 60 + get_minute - sleep_minute
        print(b - study)

Submission status: Runtime Error

Solution code:
H1,M1,H2,M2,K = map(int,input().split())
 
h = H2 - H1
m = M2 - M1
if h > 0:
    s = h * 60 + m
    s -= K
	print(s)
else:
    s = (24 + h) * 60 + m
    s -= K
	print(s)

Submission status: Runtime Error

Solution code:
#coding: utf-8
string = str(input())
X = 0; li = []
for a in range(len(string)):
  if a = " ":
    li.append(string[X:a])
    X = a
h1 = li[0];m1 = li[1];h2 = li[2];m1 = li[3];k = li[4]
Time = (h1 * 60 + m1) - (h2 * 60 + m2) - K
print(int(Time))

Submission status: Runtime Error

Solution code:
H1, M1, H2, M2, K = map(int, input().split())

startTime = (H1*60)+M1
endTime = (H2*60)+M2
time = endTime - startTime
posTime = time - k
if (posTime < 0):
  print(0)
else:
  print(posTime)

Submission status: Runtime Error

Solution code:
# coding:utf-8
import readline
import datetime

get_time = int(input())
get_minute = int(input())
sleep_time = int(input())
sleep_minute = int(input())
study = int(input())

a = (sleep_time - get_time) * 60 + sleep_minute - get_minute
print(a - study)

Submission status: Runtime Error

Solution code:
H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

if H1<H2:
    print((M2 + H2*60 - (M1 + H1*60)) - K)
else:
    print(M2 + H2*60 + ((60-M1)+(24-H1)*60) - K)

Submission status: Runtime Error

Solution code:
wakeup = 60 * H1 + M1
gotobed = 60 * H2 + M2
 
wake = gotobed - wakeup
 
answer = wake - K
 
answer

Submission status: Runtime Error

Solution code:
H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())
if H1<H2:
    print((M2 + H2*60 - (M1 + H1*60)) - K)
else:
    print(M2 + H2*60 + ((60-M1)+(24-H1)*60) - K)

Submission status: Runtime Error

Solution code:
#起きた時間
H1 = int(input())
M1 = int(input())
print(H1,':',M1)
#寝た時間
H2 = int(input())
M2 = int(input())
print(H2,':',M2)
#起きている時間(分)
K = int(input())
#分に変換
T1 = (H1 * 60) + M1
T2 = (H2 * 60) + M2

T3 = T2 - T1
if (K == T3):
    print(0)
if (K < T3):
    print(T3)

Submission status: Runtime Error

Solution code:
import numpy as np
import numpy.random as random
import scipy as sp
import pandas as pd
from pandas import Series, DataFrame
import math
 
wakeup = 60 * H
1
 + 
M
1


gotobed = 60 * H
2 + M
2


 
wake = gotobed - wakeup
 
answer = wake - K
 
answer

Submission status: Runtime Error

Solution code:
h,m,h2,m2,k=map(int,input().split())
a=h*60+m
b=h2*60+m2
if a>b:
    b+=60*24
#print(b)

print(((b-a)-k)

Submission status: Runtime Error

Solution code:
import sys
def main():
    H1, M1, H2, M2, K = map(int, input().split())
    
    h = H2 - H1 
    m = M2 - M1
    tot_minutes = h * 60 + m - K
    if tot_minutes <= 0:
        out = 0
    print(out)
main()

Submission status: Runtime Error

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

if a==c:
    t=d-b
    if e<=t:
        print(t-e)
    else:
        print(0)
    
if c>a:
    if b>d:
        t=60-b+d
        if e<=t:
        print(t-e)
    else:
        print(0)
        
    if b<=d:
        t=(c-a)*60+d-b
        if e<=t:
        print(t-e)
        else:
        print(0)

Submission status: Runtime Error

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

time = c*60+d-a*60-b

if time>=e:
  print(time-e)
else:
  print(0)

Submission status: Runtime Error

Solution code:
h1, m1, h2, m2, k = int(input().split(' '))

awake_time = (h2 - h1) * 60 + (m2 - m1)
y = awake_time - k

print(y)

Submission status: Runtime Error

Solution code:
#coding: utf-8

h1 = int(input("H₁＝"))
m1 = int(input("M₁＝"))
h2 = int(input("H₂＝"))
m1 = int(input("H₂＝"))
k = int(input("k＝"))

Time = (h1 * 60 + m1) - (h2 * 60 + m2) - K
print(int(Time))

Submission status: Runtime Error

Solution code:
import numpy as np
import numpy.random as random
import scipy as sp
import pandas as pd
from pandas import Series, DataFrame
import math
 
wakeup = 60 * H1 + M1
gotobed = 60 * H2 + M2
 
wake = gotobed - wakeup
 
answer = wake - K
 
answer

Submission status: Runtime Error

Solution code:
H1 = int(input()) * 60
M1 = int(input())
H2 = int(input()) * 60
M2 = int(input())
K = int(input())
if H1 + M1 < H2 + M2 and K<= H2 + M2 - H1 - M1:
    print(H2 + M2 - H1 - M1 - K)
else :
    pass

Submission status: Runtime Error

Solution code:
import sys

args = sys.argv

H1 = int(args[1])
M1 = int(args[2])
H2 = int(args[3])
M2 = int(args[4])
K = int(args[5])

if H1 > H2: 
    H1 -= 24

before = H1 * 60 + M1
after = H2 * 60 + M2
after -= K

time = after - before
print(time)

Submission status: Runtime Error

Solution code:
#coding: utf-8

H1 = int(input("H₁="))
M1 = int(input("M₁="))
H2 = int(input("K₂="))
M2 = int(input("M₂="))
K = int(input("K="))

T = (60 * H1 + M1) - (60 * H2 + M2) - K

print(int(T))

Submission status: Runtime Error

Solution code:
H1 = int(input()) * 60
M1 = int(input())
H2 = int(input()) * 60
M2 = int(input())
K = int(input())
print(H2 + M2 - H1 - M1 - K)

Submission status: Runtime Error

Solution code:
import numpy as np
import numpy.random as random
import scipy as sp
import pandas as pd
from pandas import Series, DataFrame
import math

wakeup = 24 * H1 + M1
gotobed = 24 * H2 + M2

wake = gotobed - wakeup

answer = wake - K

answer

Submission status: Runtime Error

Solution code:
h1,m1,h2,m2,k = int(input().split()) 
s = (h2-h1)*60 +(m2-m1) -k
print(s)

Submission status: Runtime Error

Solution code:
h1,m1,h2,m2,k=list(map(int,input().split()))
if m1=m2:
    m=0
    h=h2-h1
elif m2-m1>0:
    m=m2-m1
    h=h2-h1
else:
    m=60-m1+m2
    h=h2-h1-1
ans=k-m+h*60
if ans<=0:
    print(0)
else:
    print(ans)

Submission status: Runtime Error

Solution code:
chr = input().split(" 0 ")
print(chr)
a = (int(chr[1])-int(chr[0]))*60 - int(chr[-1])
print(a)

Submission status: Runtime Error

Solution code:
H1, M1, H2, M2, K = input().split
H1, M1, H2, M2, K = int(H1), int(M1), int(H2), int(M2), int(K)
allm1 = H1*60+M1
allm2 = H2*60+M2

m = allm2 - allm1

if m % K == 0:
  print('0')

  i = 0
while True:
  m = m - K
  if m <= 0:
    break
  else:
  	i = i + 1

print(i)

Submission status: Runtime Error

Solution code:
H1 = int(input())
H2 = int(input())
M1 = int(input())
M2 = int(input())
K = int(input())
print(60 * H2 + M2 - 60 * H1 - M1 - K)

Submission status: Runtime Error

Solution code:
h1, m1, h2, m2, k = map(int, input().split())
 
f = h1 * 60 + m1
t = h2 * 60 + m2
 
if time < 0:
  print(0)
else:
  print(time)

Submission status: Runtime Error

Solution code:
import sys
a = []
for l in sys.stdin:
    a.append(int(l))
h1, m1, h2, m2, k  = a[0].split()
H1, M1, H2, M2, K = int(h1), int(m1), int(h2), int(m2), int(k)
time = 60 * H2 + M2 - (60*H1 + M1) - K
print(time)

Submission status: Runtime Error

Solution code:
h1,m1,h2,m2,k = int(input()).split()
print((h2-h1)*60+(m2-m1+k))

Submission status: Runtime Error

Solution code:
def main():
    H1, M1, H2, M2, K = map(int, input().split())
    print( K * ( abs((sleep - 1)-start) // K) )


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
e = (c-a)*60
print(e-d)

Submission status: Runtime Error

Solution code:
guh, gum, gbh, bgm, st = map(int, input().split())
if bgm < gum:
  gbh -= 1
  bgm += 60
tmp = (gbh-guh)*60+(gbm-gum)
ans = tmp-st
print(ans)

Submission status: Runtime Error

Solution code:
h1,m1,h2,m2,k=map(int,input().split(" "))
if h1>h2:
  h2=h2+24
if m2>=m1:
  mk=m2-m1
  T=mk+(h2-h1)*60
print(T-k)

Submission status: Runtime Error

Solution code:
hour_1=H1*60
hour_2=H2*60
answer=(hour_2+M2)-(hour_1+M1)-K
print(answer)

Submission status: Runtime Error

Solution code:
i_l_s = input().split()
i_l = list(map(int, i_l_s))
 
hour = i_l[4]//60
min = i[4]%60
 
before = [i_l[0]+hour, i_l[1]+min]
after = [i_l[2], i_l[3]]
 
if(after[0]-before[0] ==0):
    print(after[1]-before[1])
else:
  print(after[1]-before[1] + 60(after[0]-before[0]))

Submission status: Runtime Error

Solution code:
h1, m1, h2, m2, k = map(int, input().split())

f = h1 * 60 + m1
t = h2 * 60 + m2

print(time)
if time < 0:
  print(0)
else:
  print(time)

Submission status: Runtime Error

Solution code:
h1,m1,h2,m2,k = map(int,input().split())
if h1 < h2:
    x = (h2-h1)*60+(m1+m2)-k
elif h1 > h2:
    x = (24-(h1-h2))*60+(m1+m2)-k
print(x)

Submission status: Runtime Error

Solution code:
if h1 <= h2:
    time = h2 * 60 + m2 - h1 * 60 + m1
else:
    time = (h2+24) * 60 + m2 - h1 * 60 + m1
if k >= time:
    print(0)
else:
    print(time - k)

Submission status: Runtime Error

Solution code:
h1,m1,h2,m2,k=map(int,input().split())
h_d=h2-h
m_d=m2-m1
if m_d<0:
    h_d-=1
    m_d=60+m2-m1
    
sum=60*h_d+m_d
sum-=k
 
if sum<0:
    print(0)
else:
    print(sum)

Submission status: Runtime Error

Solution code:
h1,m1,h2,m2,k = map(int, input().split())
h1 += m1/60
h2 += m2/60
val = h2-h1
val *= 60
val -= k
print(max(0,int(val))

Submission status: Runtime Error

Solution code:
h1,m1,h2,m2,k=map(int,input().split())
h_d=h2-h
m_d=m2-m1
if m_d<0:
    h_d-=1
    m_d=60+m2-m1
   
sum=60*h_d+m_d
sum-=k

if sum<0:
    print(0)
else:
    print(sum)

Submission status: Runtime Error

Solution code:
h1=input()
m1=input()
h2=input()
m2=input()
k=input()
i1=h1*60+m1
i2=h2*60+m2
okiterumin=i2-i1
ans=okiterumin-k
print(ans)

Submission status: Runtime Error

Solution code:
h1, m1, h2, m2, k = map(int, input().split())

ans = 0
h1 += 1
su += (h2 - h1) * 60
su += (60 - m1) + m2
print(ans-k)

Submission status: Runtime Error

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

hour = i_l[4]//60
min = i[4]%60

before = [i_l[0]+hour, i_l[1]+min]
after = [i_l[2], i_l[3]]

if(after[0]-before[0] ==0):
  else:
    print(after[1]-before[1])
else:
  print(after[1]-before[1] + 60(after[0]-before[0]))

Submission status: Runtime Error

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

main = (data[2] - date[0]) * 60 + data[3] - date[1] - data[3]

Submission status: Runtime Error

Solution code:
H_1,M_1,H_2,M_2,K = map(int,input().split())
MaxH = H_2 - H_1
if M_1 > M_2:
    MaxM = M_2 - M_1
if M_1 < M_2:
    MaxM = M_1 - M_2
useTime = MaxH*60 + MaxM
useTime -= K
print(useTime)

Submission status: Runtime Error

Solution code:
a,b,c,d,e,f = map(int,input().split())
kis = a * 60 + b
nel = c * 60 + d
print(nel - f - kis)

Submission status: Runtime Error

Solution code:
h1,m1,h2,m2,k=map(int,input().split())

if m1<=m2:
    print(max((h2-h1)*60+m2-m1-k),0)
else:
    print(max((h2-h1-1)*60+m2+60-m1-k,0))

Submission status: Runtime Error

Solution code:
H1, M1, H2, M2, K = map(int, input().split())

if h1 > h2:
    h2 += 24

h1 = H1 * 60
m1 = M1
h2 = H2 * 60
m2 = M2

print((h2 - m2) - (h1 + m1) - K)

Submission status: Runtime Error

Solution code:

h1, m1, h2, m2, k = map(int, input().split(" "))
A = list(map(int, input().split(" ")))

start = h1*60+m1
end = h2*60+m2
total = end - start - k

print(k)

Submission status: Runtime Error

Solution code:
#include<iostream>
using namespace std;
int main(){
	int a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	int f=a*60+b,g=c*60+d;
	int ans=(g-f-e);
	cout<<ans<<'\n';
}

Submission status: Runtime Error

Solution code:
h_1,m_1_h_2,m_2,k = map(int,input().split())
H = 60*h_2+m_2-(60*h_1+m_1)-k
if(H<=0):
  print(0)
else:
  print(H)

Submission status: Runtime Error

Solution code:
a,b,c,d,e = map(int,input().suplit())
s = 60*a + b
f = 60*c + d
ans = f- s - e
print(ans)

Submission status: Runtime Error

Solution code:
h1,m1,h2,m2,k = map(int,input().split())
if m2 < m1:
	m2 += 60
    h2 -= 1
m = m2-m1
h = h2-h1

if 60*h+m <= k:
	print(60*h+m)
else:
	print(k)

Submission status: Runtime Error

Solution code:
H, M, h, m, K = map(int, input().slpit())

print( max(0, 60*(h-H) + m - M - K) )

Submission status: Runtime Error

Solution code:
a,b,c,d,e = map(int,input.split())
print((c*60+d)-(a*60+b)-e)

Submission status: Runtime Error

Solution code:
H1, M1, H2, M2, K = map(int, intpu().split())
ans = 60*H2+M2-(60*H1+M1)-K
if ans < 0:
  ans = 0
print(ans)

Submission status: Runtime Error

Solution code:
a,b,c,d,e = map(str,input().suplit())
s = 60*a + b
f = 60*c + d
ans = f- s - e
print(ans)

Submission status: Runtime Error

Solution code:
h1, m1, h2, m2. k = map(int, input().split())

time = h2 * 60 + m2 - h1 * 60 + m1
if k >= time:
    print(1)
else:
    print(time - k)

Submission status: Runtime Error

Solution code:
a,b = map(int,input.split())
c,d = map(int,input.split())
e = int(input())
print((c*60+d)-(a*60+b)-e)

Submission status: Runtime Error

Solution code:
import sys
import math
import itertools
h1, m1, h2, m2, k = map(int, input().split())
print(max((h2-h1)*60 + (m2-m1)-k),0)

Submission status: Runtime Error

Solution code:
map(int,input().split())
h1,m1,h2,m2,k=map(int,input().split())

s=h1*60+m1
e=h2*60+m2

a=e-s

print(a-k)