Run ID:116105
提交时间:2025-04-06 13:08:26
import sys def count(x): return x // 3 + x // 5 - x // 15 for line in sys.stdin: N = int(line.strip()) low = 1 high = 1 while count(high) < N: high *= 2 # 二分查找 while low < high: mid = (low + high) // 2 if count(mid) >= N: high = mid else: low = mid + 1 print(low)