function main(input) { solve(...getBigIntegers(input)); } function solve(A, B, C) { let l = 1n; let r = BigInt(10e18); let count = 64; while(count-- > 0) { let X = (l + r) / 2n; let S = (X/A)*B + (X-X/A); if(S >= C) { r = X; } else { l = X; } } console.log(r.toString()); } //-- functions ------------------------------------ function getIntegers(lines) { return lines.shift().split(" ").map(function(e) { return Number(e); }); } function getBigIntegers(lines) { return lines.shift().split(" ").map(function(e) { return BigInt(e); }); } function getStrings(lines) { return lines.shift().split(" "); } function twoDimenArrayByValue(h, w, value) { const list = new Array(h); for(let i=0; i 0) str += " "; str += e; }); return str; }; main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n"));