#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 = dis2 - b2*(r-1); #ifdef DEBUG printf("r %f d %f\n", r, d); #endif long long ans = r*b3+d; printf("%lld\n", ans); return 0; }