Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Finally, after purchasing a water cooler during the April long challenge, Chef noticed that his water cooler requires 2 liters of water to cool for one hour.
How much water (in liters) would be required by the cooler to cool for N hours?
For each test case, output the number of liters of water required by the water cooler to cool for N hours.
Input: 2
1
2
Output: 2
4
Test case 1: As mentioned in the problem statement, 2 liters of water is required by the water cooler to cool for 1 hour.
Test case 2: 4 liters of water is required by the water cooler to cool for 2 hours.
#include <iostream>
using namespace std;
int main() {
int T; cin>>T;
while(T--)
{
int n;
cin>>n;
cout<<2*n<<"\n";
}
return 0;
}
t=int(input())
for i in range(t):
n=int(input())
r=n*2
print(r)
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner scn= new Scanner(System.in);
int T= scn.nextInt();
for(int i=0; i<T;i++){
int N= scn.nextInt();
System.out.println(N*2);
}
}
}
In our experience, we suggest you solve this Water Requirement 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 Water Requirement CodeChef Solution
I hope this Water Requirement 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 >>