#include using namespace std; using LL=long long; using ULL=unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) ULL GCD(ULL a,ULL b){ return b?GCD(b,a%b):a; } ULL A,B,K; ULL G; bool solve(ULL x){ ULL a=x/A, b=x/B, g=x/G; ULL c = a+b-g; return c>A>>B>>K; G=A/GCD(A,B)*B; ULL l=0, r=2000000000000000000; while(r-l>1){ ULL m=(l+r)/2; (solve(m)?l:r)=m; } cout<