#include #include int main(){ int test; scanf("%d", &test); for(;test > 0; test--){ int n, m, p, val = 0; scanf("%d%d%d", &n, &m, &p); int tmp = m*(100-p)/100; // printf("tmp=%d\n", tmp); while(n >= m){ int num; num = n / m; val+=num; n = n-n/m*m + n/m*tmp; // printf("n=%d num=%d val=%d\n", n, num, val); } printf("%d\n", val); } return 0; }