Algorithm


Problem Link : https://www.codechef.com/problems/FIT 

Problem

Chef wants to become fit for which he decided to walk to the office and return home by walking. It is known that Chef's office is  km away from his home.

If his office is open on 5 days in a week, find the number of kilometers Chef travels through office trips in a week.

Input Format

  • First line will contain , number of test cases. Then the test cases follow.
  • Each test case contains of a single line consisting of single integer .

Output Format

For each test case, output the number of kilometers Chef travels through office trips in a week.

Constraints

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

Sample 1:

Input
 
Output
 
4
1
3
7
10
10
30
70
100

Explanation:

Test case 1: The office is 1 km away. Thus, to go to the office and come back home, Chef has to walk 2 kms in a day. In a week with 5 working days, Chef has to travel 2⋅5=10 kms in total.

Test case 2: The office is 3 kms away. Thus, to go to the office and come back home, Chef has to walk 6 kms in a day. In a week with 5 working days, Chef has to travel 6⋅5=30 kms in total.

Test case 3: The office is 7 kms away. Thus, to go to the office and come back home, Chef has to walk 14 kms in a day. In a week with 5 working days, Chef has to travel 14⋅5=70 kms in total.

Test case 4: The office is 10 kms away. Thus, to go to the office and come back home, Chef has to walk 20 kms in a day. In a week with 5 working days, Chef has to travel 20⋅5=100 kms in total.

Code Examples

#1 Code Example with C Programming

Code - C Programming

#include<stdio.h>

int main(void) {
	int x,t;
	scanf("%d",&t);
	while(t--)
	{
	    scanf("%d",&x);
	    printf("%d\n",x*2*5);
	}
	return 0;
}
Copy The Code & Try With Live Editor

Input

x
+
cmd
4
1
3
7
10

Output

x
+
cmd
10
30
70
100
Advertisements

Demonstration


CodeChef solution FIT  - Fitness Codechef solution in C,C++

Previous
CodeChef solution WATERCONS -Water Consumption Codechef solution in C,C++
Next
CodeChef solotion BIRIYANI - Biryani classes CodeChef solotion in C,C++