Pagini recente » Diferente pentru blog/human-computation intre reviziile 7 si 8 | Borderou de evaluare (job #3128543) | Cod sursa (job #2513021) | Cod sursa (job #2755589) | Cod sursa (job #2711806)
#include <bits/stdc++.h>
using namespace std;
ifstream f("multiplu.in");
ofstream g("multiplu.out");
int main()
{
long long x,y;
f>>x>>y;
x=(x*y)/__gcd(x,y);
queue <long long> q;
q.push(1);
while(!q.empty())
{
long long t=q.front();
q.pop();
if(!(t%x))
{
g<<t;
return 0;
}
t*=10;
q.push(t);
q.push(t+1);
}
return 0;
}