Instagram
youtube
Facebook
Twitter

Python Maximum Submissions Program Codechef Solution

          Python Maximum Submissions Program Codechef Solution

Problem

A participant can make one submission every 30 seconds. If a contest lasts for X minutes, what is the maximum number of submissions that the participant can make during it?

It is also given that the participant cannot make any submission in the last 5 seconds of the contest.

Input Format

  • The first line of input will contain a single integer T, denoting the number of test cases.
  • Each test case consists of a single integer X, denoting the number of minutes.

Output Format

For each test case, output the maximum number of submissions a participant can make in X minutes.

 

Constraints:

  • 1≤T≤30
  • 1<=X<=30

Sample Input:

1

 2 

4

Sample Output:

2

4

6

8

 

Explanation:

Test case 1: The contest lasts for 1 minute, which is 60 seconds. A participant can make two submissions during this time—ffor example, in the 5th second and in the 48th second. Making three or more submissions is impossible.

Test case 2: The contest lasts for 2 minutes, which is 120 seconds. A participant can make four submissions during this time.

Solution:

for i in range(int(input(“Enter the number of terms needed: “))):

    t=int(input(“Enter time in minutes: “))

    print(t*2)

 

          Steps to solve this problem:

  1. Ask the user to enter a number of terms.
  2. In loop, ask the user to enter time in minutes and store it in
  3. Calculate t*2 and print the result.