1 solutions

  • 0
    @ 2025-12-3 16:38:14

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    long long n,m,x,y;
    int main()
    {
    	cin>>n>>m>>x;
    	long long lie=x/n;
    	if(x%n!=0) lie++;
    	long long hang=x%n;
    	if(hang==0) hang=n;
    //	cout<<hang<<" "<<lie;
    	if(lie==m) cout<<m*hang;
    	else cout<<m*(hang-1)+lie;
        return 0;
    }
    
    • 1

    Information

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