Problem Solution

1 solutions

  • 1
    @ 2024-08-19 16:24:06

    Code (C++):

    #include<bits/stdc++.h>
    using namespace std;
    const long long M=3e5+10,MOD=1000000000;
    typedef long long ll;
    
    int main()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
        int t=1;
        cin>>t;
        while(t--){
         int n;
         cin>>n;
         int answer=n/2;
         if(n%2==0)answer--;
         cout<<answer<<"\n";
        }
    
    
       
       return 0;
     
    }
    
  • 1

Information

ID
1073
Difficulty
1
Category
Beginners | Basic_Math , Brute_Force Click to Show
Tags
# Submissions
137
Accepted
89
Accepted Ratio
65%
Uploaded By