Algorithm


 problem Link  : https://www.codechef.com/problems/CHESSTIME 

Problem

Chef has recently started playing chess, and wants to play as many games as possible.

He calculated that playing one game of chess takes at least 20 minutes of his time.

Chef has  hours of free time. What is the maximum number of complete chess games he can play in that time?

Input Format

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

Output Format

For each test case, output on a new line the maximum number of complete chess games Chef can play in  hours.

Constraints

  • 1≤�≤10
  • 1≤�≤10

Sample 1:

Input
 
Output
 
4
1
10
7
3
3
30
21
9

Explanation:

Test case 1: If every game Chef plays takes 20 minutes, he can play 3 games in one hour.

Test case 2: If every game Chef plays takes 20 minutes, he can play 30 games in 10 hours.

Test case 3: If every game Chef plays takes 20 minutes, he can play 21 games in 7 hours.

Test case 4: If every game Chef plays takes 20 minutes, he can play 9 games in 3 hours.

Code Examples

#1 Code Example with C Programming

Code - C Programming

#include<stdio.h>
int main()
{
    int t,n,g;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d",&n);
        g=(n*60)/20;
        printf("%d\n",g);
    }
}
Copy The Code & Try With Live Editor

Input

x
+
cmd
4
1
10
7
3

Output

x
+
cmd
3
30
21
9
Advertisements

Demonstration


CodeChef solution CHESSTIME  - Chess Time Codechef solution in C,C++

Previous
CodeChef solution JERRYCHASE - Tom and Jerry Chase Codechef solution in C,C++
Next
CodeChef solution SLEEP - Sleep deprivation Codechef solution in C,C++