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: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
a,b,c,d,e=MI()
time=60*(c-a)+(d-b)
print(time-e)

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

from collections import defaultdict, deque
from sys import exit
import math
import copy
from bisect import bisect_left, bisect_right
import heapq
import sys
# sys.setrecursionlimit(1000000)
INF = 10 ** 17
MOD = 10 ** 9 + 7
def mint(lis):
    return list(map(int, lis))

def bifind(arr_sorted, x):
    idx = bisect_left(arr_sorted, x)
    if idx == len(arr_sorted):
        return False
    if arr_sorted[idx] == x:
        return True
    else:
        return False
def getyaku(n):
    ret = []
    for i in range(1, int(math.sqrt(n) + 1)):
        if n % i == 0:
            ret.append(i)
            ret.append(n // i)

    return ret

def find(x, a):
    idx = bisect_left(a, x)
    if idx == len(a):
        return False
    if a[idx] == x:
        return True
    else:
        return False

def main():
    # n = getN()
    h1, m1, h2, m2, k = getList()
    diff = h1*60 + m1 - h2*60 - m2
    print(-diff - k)
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from copy import copy, deepcopy
from collections import Counter
from math import sqrt, floor, factorial
from itertools import permutations, combinations, combinations_with_replacement
from operator import mul
from functools import reduce
import bisect

MOD = 10**9 + 7
INF = float('inf')

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

print((c-a)*60 + (d-b) - e)

Submission status: Accepted

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

Submission status: Accepted

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

ans1=(c-a)*60+d-b - e

print(max(0,ans1))

Submission status: Accepted

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

H = H2 - H1
M = M2 - M1
time = H * 60 + M

ans = time - K
print(ans)

Submission status: Accepted

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

ans = h2 - h1
ans *= 60

ans += m2 - m1

print(ans - k)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

S = H1 * 60 + M1
E = H2 * 60 + M2

print(E - K - S)

Submission status: Accepted

Solution code:
import unittest


def solve(h1, m1, h2, m2, k):
    return (h2-h1)*60+(m2-m1) - k


def main():
    h, m, h2, m2, k = map(int, input().split())
    result = solve(h, m, h2, m2, k)
    print(result)


class Test(unittest.TestCase):
    def test_solve(self):
        self.assertEqual(1, 1)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

H1, M1, H2, M2, K = map(int, readline().split())

T1 = H1*60+M1
T2 = H2*60+M2

print(max(0, T2-T1-K))

Submission status: Accepted

Solution code:
H_1, M_1, H_2, M_2, K = map(int, input().split())

h_1 = H_1 * 60 + M_1
h_2 = H_2 * 60 + M_2

print(h_2 - K - h_1)

Submission status: Accepted

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

Submission status: Accepted

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

print(60*h2+m2-k-60*h1-m1)

Submission status: Accepted

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


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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

x= a*60+b
y=c*60+d

print(y-x-e)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(60*(C-A)+D-B-E)

Submission status: Accepted

Solution code:
def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    H1, M1, H2, M2, K = ZZ()
    start = 60 * H1 + M1
    end = 60 * H2 + M2
    print(max(0, end - start - K))

    return

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
#input = sys.stdin.readline
from collections import *

def f(h, m):
    return 60*h+m

H1, M1, H2, M2, K = map(int, input().split())
a = f(H1, M1)
b = f(H2, M2)
print(b-K-a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

start = h1 * 60 + m1
end = h2 * 60 + m2
print(max(end - start - k, 0))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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

dur = (H2 - H1) * 60 + M2 - M1
print(max(0, dur - K))

Submission status: Accepted

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

answer=alist[2]*60+alist[3]-alist[0]*60-alist[1]-alist[4]
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
h,m,H,M,K=map(int,input().split())
a=(H-h)*60+(M-m)
print(a-K)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    import sys
    input=sys.stdin.readline
    h1,m1,h2,m2,k=map(int,input().split())
    t=(h2-h1)*60+(m2-m1)
    print(t-k)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n):return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print(yes if b else no)
# from sys import setrecursionlimit
# setrecursionlimit(1000000)
# from collections import Counter,deque,defaultdict
# import itertools
# import math
# import networkx as nx
# from bisect import bisect_left,bisect_right
# from heapq import heapify,heappush,heappop
h1,m1,h2,m2,k=n1()
t=h2*60+m2-h1*60-m1
print(t-k)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    h1, m1, h2, m2, k = list(map(int, input().split()))
    t1 = h1 * 60 + m1
    t2 = h2 * 60 + m2
    return t2 - t1 - k


print(main())
#print('Yes' if main() else 'No')
#print('YES' if main() else 'NO')

Submission status: Accepted

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

Submission status: Accepted

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

import sys
sys.setrecursionlimit(300000)


def solve(H: "List[int]", M: "List[int]", K: int):
    s = H[0] * 60 + M[0]
    t = H[1] * 60 + M[1]
    ret = t - s - K
    print(ret)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = [int()] * (2)  # type: "List[int]"
    M = [int()] * (2)  # type: "List[int]"
    for i in range(2):
        H[i] = int(next(tokens))
        M[i] = int(next(tokens))
    K = int(next(tokens))  # type: int
    solve(H, M, K)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float("inf")


def main():
    H1, M1, H2, M2, K = map(int, readline().split())
    MM1 = H1*60+M1
    MM2 = H2*60+M2
    print(max(MM2-MM1-K, 0))
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

t1 = H1 * 60 + M1
t2 = H2 * 60 + M2
print(max(0, t2 - t1 - K))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print((h2-h1)*60 + (m2-m1) - k)

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    H1, M1, H2, M2, K = LI()

    print((60*H2+M2)-(60*H1+M1)-K)

if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(700000)

def s_in():
    return input()

def n_in():
    return int(input())

def l_in():
    return list(map(int, input().split()))

h1,m1,h2,m2,k=l_in()
print(h2*60+m2-k-h1*60-m1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
def resolve():
    H1,M1,H2,M2,K=pin()
    t1=H1*60+M1
    t2=H2*60+M2
    print(t2-t1-K)
#%%submit!
    
resolve()

Submission status: Accepted

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

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

print((H2*60+M2)-(H1*60+M1)-K)

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

h1, m1, h2, m2, k = map(int, input().split())
diff = h2 * 60 + m2 - h1 * 60 - m1
print(diff - k)

Submission status: Accepted

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

m = (H2 - H1) * 60 + (M2 - M1)

print(m - K)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####MakePrimes######
def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############
H1,M1,H2,M2,K = IL()

print(H2*60+M2-H1*60-M1-K)

Submission status: Accepted

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

print(main())
#if main():
#    print('Yes')
#else:
#    print('No')

Submission status: Accepted

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

t1 = 60*H1 + M1
t2 = 60*H2 + M2

print(t2 - t1 - K)

Submission status: Accepted

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

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

    print(ret)


if __name__ == '__main__':
    main()

# import sys
# input = sys.stdin.readline
# 
# sys.setrecursionlimit(10 ** 7)
# 
# (int(x)-1 for x in input().split())
# rstrip()
#
# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok

Submission status: Accepted

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

H1 *= 60
H2 *= 60

T1 = H1 + M1
T2 = H2 + M2

print(T2 - T1 - K)

Submission status: Accepted

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

Submission status: Accepted

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

alltime = (H2-H1)*60 + M2-M1

print(alltime-K)

Submission status: Accepted

Solution code:
h,m,hh,mm,k=list(map(int,input().split()))

hm=h*60+m
hhmm=hh*60+mm

ans=hhmm-k-hm
print(ans)

Submission status: Accepted

Solution code:
def main():
	h,m,h2,m2,k = map(int,input().split())
	
	mins = (h2-h)*60 + (m2-m)

	print(mins-k)


if __name__ == '__main__':
	main()

Submission status: Accepted

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

s = (h2-h1)*60
s += m2-m1

s -= k

print(s)

Submission status: Accepted

Solution code:
import sys
import math

sys.setrecursionlimit(1000000)


def solve(H1, M1, H2, M2, K):
    S = H1 * 60 + M1
    E = H2 * 60 + M2
    return max(0, E-S-K)


if __name__ == "__main__":
    H1, M1, H2, M2, K = tuple(map(int, input().split(" ")))
    print(solve(H1, M1, H2, M2, K))

Submission status: Accepted

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

Submission status: Accepted

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

t = C - A
y = D - B
d = t*60 + y
ans = d - K
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    a, b, c, d, e = list(map(int, readline().split()))

    x = a * 60 + b
    y = c * 60 + d
    z = y - x

    print(z-e)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:


h,m,h2,m2,k = map(int,input().split())

a = h2 - h
b = m2 - m

minu = a * 60 + b

print(minu - k)

Submission status: Accepted

Solution code:
from collections import deque
import math

def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

h1,m1,h2,m2,k = NextInts()

x1 = h1*60 + m1
x2 = h2 * 60 + m2

print(x2-x1-k)

Submission status: Accepted

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

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

dif = m2 - m1

print(max(0, dif - k))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print((H2*60+M2)-(H1*60+M1)-K)

Submission status: Accepted

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

hour=h2-h1
minu=m2-m1

sum=hour*60+minu

print(sum-k)

Submission status: Accepted

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

t1 = h1 * 60 + m1
t2 = h2 * 60 + m2

ans = t2 - t1 - k
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

h1,m1,h2,m2,k = map(int,ipt().split())

print((h2-h1)*60+(m2-m1)-k)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
h1, m1, h2, m2, k = map(int, input().split())
print(max(0, h2*60+m2-(h1*60+m1)-k))

Submission status: Accepted

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

Submission status: Accepted

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

    t1 = h1 * 60 + m1
    t2 = h2 * 60 + m2
    ans = (t2 - t1) - k

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

a1 = H1 * 60 + M1
a2 = H2 * 60 + M2
print(a2 - a1 - K)

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k = [int(hoge) for hoge in input().split()]
diff = h1*60 + m1 - h2*60 - m2
diff *= -1
print(max(0,diff-k))

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H1, M1, H2, M2, K = MAP()

t1 = 60*H1+M1
t2 = 60*H2+M2

print(t2-t1-K)

Submission status: Accepted

Solution code:
h, m, h2, m2, k = map(int, input().split())
print(max(0, (h2*60+m2)-(h*60+m)-k))

Submission status: Accepted

Solution code:
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

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

    t1 = h1*60+m1
    t2 = h2*60+m2
    print(t2-t1-k)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#頑張るぞい！
H1,M1,H2,M2,K=map(int,input().split())
T1=H1*60+M1
T2=H2*60+M2
print(T2-T1-K)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# N = int(input())
# A,B = map(int,input().split())
# li = list(map(int,input().split()))

h1,m1,h2,m2,k = map(int,input().split())
h = (h2-h1)*60+m2-m1

print(h-k)






# if :
#     print("Yes")
# else:
#     print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
h,m,H,M,K=map(int,input().split())
t=h*60+m
T=H*60+M
print(T-t-K)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

h1, m1, h2, m2, k = map(int, readline().split())
time = h2 * 60 + m2 - h1 * 60 - m1
ans = time - k
print(max(0, ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
h, m, h2, m2, k = map(int, input().split())
a = (h2 - h) * 60 + (m2 - m)
print(a-k)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

x = 60 * a + b
y = 60 * c + d

print(y - x - k)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    h,m,H,M,k = LI()
    t = 60*(H-h)+M-m
    print(max(0,t-k))
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

start = 60*h1+m1
end = 60*h2+m2
res = (end-start-k)


print(res)

Submission status: Accepted

Solution code:
h1,m1,h2,m2,k = [int(i) for i in input().split()]

print((h2-h1)*60+(m2-m1)-k)

Submission status: Accepted

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

a = (h2 - h1) * 60 + (m2 - m1)
print(a - k)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

h,m,hh,mm,K=map(int,input().split())
t=h*60+m
tt=hh*60+mm
print(max(tt-t-K,0))

Submission status: Accepted

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
h1,m1,h2,m2,k = readInts()
print(h2*60 + m2 - h1*60 - m1 - k)

Submission status: Accepted

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

Submission status: Accepted

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

t1 = 60*h1+m1
t2 = 60*h2+m2

print(t2-t1-k)

Submission status: Accepted

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

print(c*60+d-a*60-b-e)

Submission status: Accepted

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

Submission status: Accepted

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