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;
cout<<((n-1)/2 + 1)<<endl;
}
return 0;
}
Copy The Code &
Try With Live Editor
Input
4
1
2
3
4
1
2
3
4
Output
1
1
2
2
1
2
2
Demonstration
Codeforcess solution 1371-A A. Magical Sticks ,C++, Java, Js and Python,1371-A,Codeforcess solution