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