P1150 Peter的烟 发表于 2021-08-02 更新于 2026-08-08 分类于 algorithm 本文字数: 33 阅读时长 ≈ 1 分钟 123456789101112#include<stdio.h>int main(){ long int n, k, res; scanf("%ld%ld", &n, &k); res = n; while(n/k){ res += (n / k); n = n % k + n / k; } printf("%ld", res); return 0;}