# 12613 - Yet Another Meme Problem ## 題解: a⋅b + a + b = a⋅10^|b| + b b + 1 = 10^|b| 因此b只會是999...999,先將長度算出來,答案就是乘於a。 ## Code: ```c=1 #include <stdio.h> #define ll long long int ll t, a, b; int getLen(int x){ int res = 0; while(x){ res++; x /= 10; } return res; } int main(){ scanf("%lld", &t); while(t--){ scanf("%lld%lld", &a, &b); int len = getLen(b + 1); ll ans = a * (len - 1); printf("%lld\n", ans); } return 0; } ``` ###### tags: `NTHUOJ`