Untitled

mail@pastecode.io avatar
unknown
java
2 years ago
332 B
2
Indexable
Never
    public static int maxDias(int N, int p, int q, int r) {
        int sol = 0;
        int cont = 0;
        for (int i = 1 ; i <= N ; i++){
            cont = 0;
            if (i%p == 0)cont++;
            if (i%q == 0)cont++;
            if (i%r == 0)cont++;
            if (cont == 1)sol++;
        }
        return sol;
    }