#include <stdio.h>
#include <math.h>
//We define g as a constant
#define g 9.8

int main()
{
    //We define all variables we're going to use..
    float v0,h,t,vy,v;
    //We ask for horizontal speed and altitude from the user.
    printf("Enter initial horizontal speed: ");
    scanf("%f",&v0);
    printf("\nEnter the altitude the object's thrown: ");
    scanf("%f",&h);
    //We calculate t and print it out.
    t=sqrt(h*2/g);
    printf("\n\nTime: %f\n",t);
    //We don't need horizontal distance anywhere else.
    //So we don't calculate it into a variable.
    printf("Horizontal distance: %f\n",v0*t);
    //We calculate the vertical speed.
    vy=g*t;
    printf("Vertical impact speed: %f\n",vy);
    //We calculate the impact speed with pythagoras...
    printf("Total impact speed: %f\n",sqrt(pow(v0,2)+pow(vy,2)));
    return 0;
}
