Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
#include
using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(false); ll x, n; cin >> x >> n; for(ll i = 0; i < n; i++) { ll sqr = sqrt(x); ll max_divisor = 1; for(ll j = 2; j <= sqr; j++) { if(x % j == 0) { max_divisor = max(max_divisor, j); if(x / j != j) { max_divisor = max(max_divisor, x / j); } break; } } x += max_divisor; } cout << x << endl; return 0; }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)