SHARE
TWEET

Untitled

a guest Sep 17th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bank = [0, 0, 0]
  2. time = []
  3. n = int(input())
  4. for i in range(n):
  5.     x, y = map(int, input().split())
  6.     time.append(x * 60 + y)
  7. for i in range(n):
  8.     r = min(bank)
  9.     ind = 0
  10.     for j in range(3):
  11.         if bank[j] == r:
  12.             ind = j
  13.     if bank[ind] > time[i]:
  14.         x = bank[ind] + 30
  15.         print(x // 60, x % 60)
  16.     else:
  17.         x = time[i] + 30
  18.         print(x // 60, x % 60)
  19.     bank[ind] = max(time[i], bank[ind]) + 30
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top