Problem 1001 happy birthday!

Wmy776 | 2015-07-25 19:20:34Author
#include <stdio.h> int main() { unsigned int T; scanf("%d",&T); while(T--) { unsigned int p,q,m,n; scanf("%d%d%d%d",&n,&m,&p,&q); printf("%d\n",(n/q)*q+p*(n%q)); } return 0; }