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 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
Sample 1:
4 1 3 7 10
10 30 70 100
Explanation:
Test case : The office is km away. Thus, to go to the office and come back home, Chef has to walk kms in a day. In a week with working days, Chef has to travel kms in total.
Test case : The office is kms away. Thus, to go to the office and come back home, Chef has to walk kms in a day. In a week with working days, Chef has to travel kms in total.
Test case : The office is kms away. Thus, to go to the office and come back home, Chef has to walk kms in a day. In a week with working days, Chef has to travel kms in total.
Test case : The office is kms away. Thus, to go to the office and come back home, Chef has to walk kms in a day. In a week with working days, Chef has to travel 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
1
3
7
10
Output
30
70
100
Demonstration
CodeChef solution FIT - Fitness Codechef solution in C,C++