You have about 40–50 minutes to solve seven problems. Each problem reads the whole contest input from standard input and prints the exact output. Read the input in your program with:
import sys
data = sys.stdin.read()
Write each answer as a complete program in your notebook, and run it with piped input, for example python my_solution.py < case.txt. Do not call input().