#include int main(void){ int tb1, tb2, tb3; scanf("%d%d%d", &tb1, &tb2, &tb3); float b1 = tb1, b2 = tb2, b3 = tb3; float dis1, dis2; dis1 = b2-b1; dis2 = b3-b2; float r = (dis2-dis1)/(b2-b1)+1; float d = b2 - r * b1; #ifdef DEBUG printf("r %f d %f\n", r, d); #endif int ans = r*b3+d; printf("%d\n", ans); return 0; }