#include<stdio.h> int main() { int n,k,l;//n->վ̨ k->³õʼÈËÊý l-> ÏÞ³ÉÈËÊý int i; while( scanf("%d%d%d",&n,&k,&l)!=EOF) { if(n==0&&k==0&&l==0) break; int temp = k; for(i=0;i<n-2;i++) { temp = (temp-temp/2)+temp; if(temp<=l) { k = temp; } } printf("%d\n",k); } } |
Double click to view unformatted code.