Submission #1294262

#TimeUsernameProblemLanguageResultExecution timeMemory
1294262saleh_mursudluKangaroo (CEOI16_kangaroo)C++20
0 / 100
1 ms568 KiB
#include <bits/stdc++.h>
using namespace std;
int main() {
    long long n,m,a,b,c,d,x;
    cin>>a>>b>>c;
    if(a-b==b){
        if(b<c){
             long long k=1;
             long long i=1;
             long long h=a-b;
            while(h!=1){
                if(i%2==1){
                    k*=b;
                }
                else{
                    k*=h;
                }
                b--;
                h--;
                i++;

            }
              cout<<k<<endl;
        }
        else{
            long long k=1;
             long long i=1;
             long long h=a-b;
            while(b!=1){
                if(i%2==1){
                    k*=b;
                }
                else{
                    k*=h;
                }
                b--;
                h--;
                i++;

            }
              cout<<k<<endl;
        }
    }
    else{
        if(a-b>b){
             long long k=1;
             long long i=1;
             long long h=a-b;
            while(h!=1){
                if(i%2==1){
                    k*=b;
                }
                else{
                    k*=h;
                }
                b--;
                h--;
                i++;

            }
              cout<<k<<endl;
        }
        else{
             long long k=1;
             long long i=1;
             long long h=a-b;
            while(b!=1){
                if(i%2==1){
                    k*=b;
                }
                else{
                    k*=h;
                }
                b--;
                h--;
                i++;

            }
              cout<<k<<endl;
        }
    
    
}}

#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...