File tree 1 file changed +46
-0
lines changed
1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ // ॐ नमः शिवाय
2
+ #include < bits/stdc++.h>
3
+ using namespace std ;
4
+
5
+ #define ll long long
6
+ #define pb push_back
7
+ #define ff first
8
+ #define ss second
9
+ #define mp make_pair
10
+
11
+ // Code Written By: Vikash Patel
12
+ // Codeforces Profile: https://codeforces.com/profile/vikashpatel
13
+
14
+ int solve (int n)
15
+ {
16
+ if (n%7 == 0 )
17
+ return n;
18
+ for (int i=0 ; i<10 ; i++)
19
+ {
20
+ int x = ((n/10 )*10 ) + i;
21
+ if (x % 7 == 0 )
22
+ return x;
23
+ }
24
+ }
25
+
26
+ int main ()
27
+ {
28
+ ios_base::sync_with_stdio (0 );
29
+ cin.tie (0 );
30
+ cout.tie (0 );
31
+
32
+ // #ifndef ONLINE_JUDGE
33
+ // freopen("input.txt", "r", stdin);
34
+ // freopen("/Users/vikash/Desktop/output.txt", "w", stdout);
35
+ // #endif
36
+
37
+ int t;
38
+ cin>>t;
39
+ while (t--)
40
+ {
41
+ int n;
42
+ cin>>n;
43
+ cout<<solve (n)<<endl;
44
+ }
45
+ return 0 ;
46
+ }
You can’t perform that action at this time.
0 commit comments