Friday, February 1, 2019

URI 1197:: SOLUTION

URI Online Judge | 1197

Back to High School Physics

A particle has initial velocity and constant acceleration. If its velocity after certain time is v then what will its displacement be in twice of that time?

Input

The input will contain two integers in each line. Each line makes one set of input. These two integers denote the value of (-100 ≤ ≤ 100) and t(0 ≤ ≤ 200) ( means at the time the particle gains that velocity). The end of the input is determined by EOF.

Output

For each line of input print a single integer in one line denoting the displacement in double of that time.
Input SampleOutput Sample
0 0
5 12
0
120




[WAIT]
     First of all, think yourself that you have tried enough for the problem. If you did not please read the program once. REMEMBER one thing, just believe in yourself.....YOU CAN.....YOU KNOW....


                                                                  ::SOLUTION::



#include<stdio.h>

int main()
{
    int a, v, t;
    while(scanf("%d %d",&v,&t)!=EOF)
    {
        a = 2*v*t;
        printf("%d\n",a);
    }
    return 0;
}

No comments:

Post a Comment