#include int main() { int n,m,a,b; while(scanf("%d%d",&n,&m)!=EOF){ int min_=0; for(int i=0; i=a){ t-=a; min_+=b; } if(t>0) min_+=b; } else{ while(t>=a){ t-=a; tmp+=b; } if(t>0) tmp+=b; if(tmp