1 solutions

  • 0
    @ 2025-11-5 17:08:14

    C++ :

    #include <stdio.h>
    int main()
    {
    	//freopen( "in.txt" , "r" , stdin ) ;
    	//freopen( "out.txt" , "w" , stdout ) ;
    
     	int n , m ;
     	while( ~scanf ( "%d%d" , &n , &m ) ) {
            if( m % n == 0 ) printf( "%d\n" , n - 1)  ;
    		 else printf( "%d\n" , m % n - 1 ) ;
    	 }
    	return 0 ;
    }
    
    • 1

    Information

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