Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
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 N hours of free time. What is the maximum number of complete chess games he can play in that time?
For each test case, output on a new line the maximum number of complete chess games Chef can play in N hours.
Input: 4
1
10
7
3
Output: 3
30
21
9
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.
#include <iostream>
using namespace std;
int main() {
int n,tc;
cin>>tc;
for(int i=0;i<tc;i++){
cin>>n;
cout<<n*3<<endl;
}
return 0;
}
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-->0){
int k = sc.nextInt();
System.out.println((k*60)/20);
}
}
}
T=int(input())
for i in range(T):
N=int(input())
print((N*60)//20)
In our experience, we suggest you solve this Chess Time CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.
If you are stuck anywhere between any coding problem, just visit Queslers to get the Chess Time CodeChef Solution
I hope this Chess Time CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
Keep Learning!
More Coding Solutions >>