import std.stdio; import std.string; import std.conv; import std.algorithm; import std.array; import std.math; import std.range; import std.bigint; void main() { auto l = readln.chomp.split.map!(to!long).array; long a = l[0], b = l[1], c = l[2]; long lb = 1L, rb = 1e18.to!long, mid; if (c <= b * lb / a + lb - lb / a) lb.writeln; else { while (rb - lb > 1) { mid = (lb + rb) / 2; BigInt money = BigInt(b) * BigInt(mid / a) + BigInt((mid - mid / a)); //writeln(money); if (money > BigInt(c)) { rb = mid; } else if (money < BigInt(c)) { lb = mid; } else { rb = mid; break; } } } // これlbですでにOKな場合だけでは…? //if (BigInt(b) * BigInt(lb / a) + BigInt((lb - lb / a)) >= BigInt(c)) rb = lb; rb.writeln; }