#include <stdlib.h>
#include <stdio.h>
#include <math.h>


void Usage(){
    printf("./age-per current expected\n");
	printf("current = your current age\n");
	printf("expected = age you expect to live to\n");
    printf("output: The time from now until then will seem about as long as the time from when you were X\n");
}

int main(int argc, char **argv){
    double cur_age = 0;
    double exp_age = 0;
    double ref_age = 0;
    double tmp1 = 0;
	//double tmp2 = 0;
    //double tmp1 = 0;
    //double tmp2 = 0;

    if(argc != 3){
        Usage();
        exit(1);
    }

    cur_age = atof(argv[1]);
    exp_age = atof(argv[2]);

	tmp1 = exp_age / cur_age;
	ref_age = cur_age / tmp1;
	
	printf("current age: %lf\n", cur_age);
	printf("expected age: %lf\n", exp_age);
	printf("reference age: %lf\n", ref_age);
	

    printf("the time you have left should seem about as long away as when you were %.02lf\n", ref_age);
	printf("or %lfyrs\n", cur_age-ref_age);

    return 0;
}