The first equation of motion states that where is the initial velocity, is the final velocity, is the acceleration, and is the time the object spends in motion.
You calculate the acceleration of a car and conclude that it has an acceleration of .
Given the initial velocity and the time the car spends accelerating, can you determine the final velocity of the car?
Input Specification
The input consists of two lines. The first line contains an integer , representing the initial velocity. The second line contains an integer , representing the time the car spends in motion.
Output Specification
Output the final velocity of the car.
Sample Input 1
10
3
Output for Sample Input 1
19
Explanation of Output for Sample Input 1
When the initial velocity is and the time in motion is seconds, we find that the final velocity is .
Sample Input 2
10
4
Output for Sample Input 2
22
Explanation of Output for Sample Input 2
When the initial velocity is and the time in motion is seconds, we find that the final velocity is .
Comments
Because the car has an acceleration of 3 so 3 seconds multiplied by 3 = 9 + 10 = 19
why do you times everything by 3
For anyone submitting an answer written in C++ 20 in the future, I needed to add a blank line at the end. Not sure about other languages.