-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnit.cpp
More file actions
29 lines (29 loc) · 799 Bytes
/
nit.cpp
File metadata and controls
29 lines (29 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include<iostream>
using namespace std;
long long n,i;
string s;
typedef long long ll;
#define nit( i, n) for(i=0;i<n;i++)
int gcd(int a,int b){ if(b==0) return a; else return gcd(b,a%b);}
bool iseven(int n){return ((n&1)==0)?true:false;}
int pov(int n,int m){ int c=1; while(m>0){ if(!iseven(m)){ c=c*n; } n=n*n; m=m>>1; } return c; }
unsigned int intlen(unsigned int n){return n ? intlen(n/10)+1 : 0;}
bool isprime(int x) { for (int d = 2; d * d <= x; d++) { if (x % d == 0) return false; }return true; }
int main(){
#ifndef ONLINE_JUDGE
freopen("ipt.txt","r",stdin);
freopen("out.txt","w",stdout);
#endif
ll t;
cin>>t;
while(t--){
cin>>n;
if(n%7==0){
cout<<n<<endl;
}
else{
cout<<(n-(n%7))<<endl;
}
}
return 0;
}