Advertisement
Saleh127

LO 1336

Nov 29th, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5. int main()
  6. {
  7. ios_base::sync_with_stdio(0);
  8. cin.tie(0);cout.tie(0);
  9.  
  10. test
  11. {
  12. ll a,b,c,odd;
  13. cin>>a;
  14. b=sqrt(a);
  15. c=sqrt(a/2);
  16. odd=a-(b+c);
  17.  
  18.  
  19. cout<<"Case "<<cs<<": "<<odd<<endl;
  20.  
  21. /*
  22. SOD value can be written as ,
  23.  
  24. SOD(n)=(p1^(e1+1)-1)/p1-1 *(p2^(e2+1)-1)/p2-1 * (p3^(e3+1)-1)/p3-1
  25. from this equation we can said that if SOD value is odd then the
  26. power of each prime factor should be EVEN except 2.
  27. Because ,only even power of a prime factor, gives odd value.
  28. n=2^2i*p^2 ,for odd value.2^2i gives odd value and p^2 for other prime numbers
  29. also gives odd value.odd*odd value is a odd value.
  30. n=2^(2i+1)*p^2 others odd
  31.  
  32. 2^i*p = sqrt(n)
  33. 2^i*p = sqrt(n/2);
  34. */
  35. }
  36.  
  37.  
  38. return 0;
  39. }
  40.  
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement