1 solutions

  • 0
    @ 2025-3-3 16:24:11

    C++ :

    #include<iostream>
    #include<cstdio>
    using namespace std;
    int main()
    {
    
    	int n,k,s,t,r;
    	cin>>n>>k;
    	for(int i=1;i<=k;i++)
    	{
    		cin>>s>>t>>r;
    		int time=(n-1)/s+1;//2
    		int ans=time+r*((time-1)/t);
    		cout<<ans<<endl;
    	}
    	return 0;
    }
    
    
    • 1

    Information

    ID
    10045
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By