Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
int n;
while(t--){
cin>>n;
if(n%2 != 0){
n--;
cout<<(n/2)<<endl;
continue;
}
cout<<(n/2)<<endl;
}
return 0;
}
Copy The Code &
Try With Live Editor
Input
2
3
5
3
5
Output
1
2
2
Demonstration
Codeforcess solution 1370-A A. Maximum GCD ,C++, Java, Js and Python,1370-A,Codeforcess solution