func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     long long int t;     cin >> t;     while (t--) {       long long int a, b;       cin >> a >> b;       long long int r1 = 45;       long long int s1 = 10;       long long int r2 = 20;       long long int s2 = 5;       long long int r3 = 45;       long long int s3 = 10;       long long int r4 = 20;       long long int s4 = 5;       long long int r5 = 5;       long long int s5 = 2;       long long int r6 = 20;       long long int s6 = 5;       long long int r7 = 45;       long long int s7 = 10;       long long int r8 = 20;       long long int s8 = 5;       long long int r9 = 45;       long long int s9 = 10;       long long int digit = b % 10;       long long int sum = 0;       if (digit == 1) {         sum = (a / (b * s1)) * r1;         long long int loop = ((b * s1) * (a / (b * s1))) + b;         for (long long int i = loop; i <= a; i = i + b) {           sum += i % 10;         }       }       if (digit == 2) {         sum = (a / (b * s2)) * r2;         long long int loop = ((b * s2) * (a / (b * s2))) + b;         for (long long int i = loop; i <= a; i = i + b) {           sum += i % 10;         }       }       if (digit == 3) {         sum = (a / (b * s3)) * r3;         long long int loop = ((b * s3) * (a / (b * s3))) + b;         for (long long int i = loop; i <= a; i = i + b) {           sum += i % 10;         }       }       if (digit == 4) {         sum = (a / (b * s4));         sum *= r4;         long long int loop = (a / (b * s4));         loop *= (b * s4);         loop += b;         for (long long int i = loop; i <= a; i = i + b) {           sum += i % 10;         }       }       if (digit == 5) {         sum = (a / (b * s5)) * r5;         long long int loop = ((b * s5) * (a / (b * s5))) + b;         for (long long int i = loop; i <= a; i = i + b) {           sum += i % 10;         }       }       if (digit == 6) {         sum = (a / (b * s6)) * r6;         long long int loop = ((b * s6) * (a / (b * s6))) + b;         for (long long int i = loop; i <= a; i = i + b) {           sum += i % 10;         }       }       if (digit == 7) {         sum = (a / (b * s7)) * r7;         long long int loop = ((b * s7) * (a / (b * s7))) + b;         for (long long int i = loop; i <= a; i = i + b) {           sum += i % 10;         }       }       if (digit == 8) {         sum = (a / (b * s8)) * r8;         long long int loop = ((b * s8) * (a / (b * s8))) + b;         for (long long int i = loop; i <= a; i = i + b) {           sum += i % 10;         }       }       if (digit == 9) {         sum = (a / (b * s9)) * r9;         long long int loop = ((b * s9) * (a / (b * s9))) + b;         for (long long int i = loop; i <= a; i = i + b) {           sum += i % 10;         }       }       cout << sum <<   n ;     }     return 0;   }   