#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 0;i < n;i++) {
int m1,m2;
cin >> m1 >> m2;
while (m1 != m2) {
if (m1 < m2) {
m2 /= 2;
}
else {
m1 /= 2;
}
}
cout << m1 * 10 << "\n";
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: