Cod sursa(job #3195404)

Utilizator popuPop Matei Tudor popu Data 20 ianuarie 2024 18:20:57
Problema Multiplu Scor 20
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.37 kb
#include <bits/stdc++.h>

using namespace std;

ifstream fin("multiplu.in");
ofstream fout("multiplu.out");

long long x,y,rez;
queue<long long> q;

int main()
{
    fin>>x>>y;
    q.push(1);
    while(q.front()%x || q.front()%y)
    {
        q.push(q.front()*10);
        q.push(q.front()*10+1);
        q.pop();
    }
    fout<<q.front();

    return 0;
}