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; while (rb - lb > 1) { mid = (lb + rb) / 2; BigInt money = BigInt(b) * BigInt(mid / a) + BigInt((mid - mid / a)); if (money > BigInt(c)) { rb = mid; } else if (money < BigInt(c)) { lb = mid; } else { rb = mid; break; } } rb.writeln; }