80分最后一个测试点
查看原帖
80分最后一个测试点
679634
riki1230楼主2023/9/2 12:38
#include <bits/stdc++.h>
using namespace std;
int main(){
    int x,y,t;
    cin>>x>>y>>t;
    long long s,tim,f=1;
    s=t*x;
    if(s+x<f*y){
        cout<<s<<endl;
        return 0;
    }
    for(int i=1;;i++){
        if(s+f*x==f*y){
            cout<<f*y<<endl;
            return 0;
        }else if(s+f*x>f*y){
            f++;
        }else{
            cout<<s+(f-1)*x<<endl;
            return 0;
        }
    }
    return 0;
}
2023/9/2 12:38
加载中...