sanket_2024's blog

By sanket_2024, history, 6 years ago, In English

include <bt bits/extc++.h>

using namespace std;

define min(a,b) ((a)<(b)?(a):(b))

define max(a,b) ((a)>(b)?(a):(b))

define lli long long int

define ll long long

int main() { lli n,k,c,t.i; cin>>t; while(t--) { cin>>n>>k; c=n; for(i=2; i<=10; i++) { if(n%i==0) { c=i; break; } }

n+=c;
cout<<n+(k-1)*2<<"\n";

} return 0; }

  • Vote: I like it
  • -4
  • Vote: I do not like it

| Write comment?
»
6 years ago, hide # |
← Rev. 2  
Vote: I like it +8 Vote: I do not like it

I think it has something to do with formatting. Try to submit after making font & color the same for all lines. Or at least replace bits/stdc++.h with bt bits/extc++.h.

»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

The loop for finding the smallest divisor of $$$n$$$ that is larger then 1 should not have an upper-limit of 10. Check the following update.

111745818