hdu 2211
题意: 中文题目,自己看..............
递归调用....
没什么难度,注意下long long就行........
AC代码:
#include <iostream> #define LL long long using namespace std; LL L(LL n,int k) { if(n==k) return k; int a=L(n-n/k,k); return (a-1)/(k-1)+a; } int main() { LL n; int k,t; cin>>t; while(t--) { cin>>n>>k; cout<<L(n,k)<<endl; } return 0; }