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 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
Sample 1:
4 1 10 7 3
3 30 21 9
Explanation:
Test case : If every game Chef plays takes minutes, he can play games in one hour.
Test case : If every game Chef plays takes minutes, he can play games in hours.
Test case : If every game Chef plays takes minutes, he can play games in hours.
Test case : If every game Chef plays takes minutes, he can play games in 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
1
10
7
3
Output
30
21
9
Demonstration
CodeChef solution CHESSTIME - Chess Time Codechef solution in C,C++