Solution to the problem number CODILITY_A-T3CHFEST_2019 of Codility - CODILITY_A-T3CHFEST_2019.

Any questions do not hesitate to contact.

#include <bits/stdc++.h>
using namespace std;

int gcd(int a, int b) {
    while (b > 0)
    {
        int temp = b;
        b = a % b;
        a = temp;
    }
    return a;
}

int solution(int N,int M)
{
    return N/gcd(N, M);
}
int main()
{
    int M = 20;
    for(int i=1; i<M;i++)
        for(int j=1; j<M;j++)
         printf("%d\n",solution(i,j));
    return 0;
}

Don't miss anything.

Keep in touch with Isaac Lozano Osorio!