https://www.acmicpc.net/problem/13410
c++
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int N,K;
int main() {
cin>>N>>K;
int ans=0;
for(int i=1;i<=K;i++)
{
string s = to_string((i*N));
reverse(s.begin(),s.end());
int tmp = stoi(s);
ans=max(ans,tmp);
}
cout<<ans;
}