fork download
  1. /**
  2.  * author: orzvanh14 ( )
  3.  * created: 23.12.2022 10:08:02
  4.  * too lazy to update time
  5. **/
  6. // i wants to take ioi
  7. //binhtinhtutinkhongcaycunhungmotkhikhongcontutinnualatuyetvong
  8. #include <bits/stdc++.h>
  9.  
  10. using namespace std;
  11.  
  12. #define int long long
  13. #define nn "\n"
  14. #define pi pair<int, int>
  15. #define fi first
  16. #define se second
  17. #define lb lower_bound
  18. #define ub upper_bound
  19. #define eb emplace_back
  20. #define pb push_back
  21. #define TASK " "
  22.  
  23. #define ms(a, x) memset(a, x, sizeof(a))
  24. #define all(a) a.begin(), a.end()
  25. #define All(a, n) a + 1, a + 1 + n
  26.  
  27. #define LOG 19
  28.  
  29.  
  30. const int INF = 1e18;
  31. const int mod = 1e9+7;
  32. const int N = 1e6 + 5;
  33. const int maxN = 2e5 + 3;
  34. int MOD = 998244353;
  35. int bit[200000];
  36. struct node{
  37. int kc, u, hk;
  38. bool operator<(const node& other) const {
  39. return kc > other.kc;
  40. }
  41. };
  42. struct edge{
  43. int v, w, h;
  44. };
  45.  
  46. void nhap(){
  47.  
  48. }
  49. void solve(){
  50. int n; cin >> n;
  51. int ans = 0;
  52. for(int i = 2; i * i <= n; i++){
  53. if(n % i == 0){
  54. ans = i;
  55. while(n % i == 0){
  56. n /= i;
  57. }
  58. }
  59. }
  60. if(n > 1){
  61. ans = n;
  62. }
  63. cout << ans << nn;
  64. }
  65. signed main() {
  66. // freopen("uocnt.inp", "r", stdin);
  67. // freopen("uocnt.out", "w", stdout);
  68. ios_base::sync_with_stdio(0);
  69. cin.tie(0);
  70. cout.tie(0);
  71. // int t;
  72. // cin >> t;
  73. // while(t--) solve();
  74. solve();
  75. return 0;
  76.  
  77. }
  78.  
Success #stdin #stdout 0.01s 5296KB
stdin
2016
stdout
7