Cod sursa(job #3251008)

Utilizator Luca_georgescuLucageorgescu Luca_georgescu Data 24 octombrie 2024 16:03:34
Problema Pascal Scor 10
Compilator cpp-64 Status done
Runda cex_1 Marime 0.38 kb
#include <bits/stdc++.h>
#define ll long long

using namespace std;

ifstream f("pascal.in");
ofstream g("pascal.out");

ll r,d,nr,c;

int main()
{
    ios_base::sync_with_stdio(false);
    f.tie(NULL);
    f >> r >> d;
    ll c=1;
    for (ll j=1; j<=r; j++ )
    {
        c=c*(r-j+1)/j;
        if ( c%d==0 )
            nr++;
    }
    cout << nr;
    return 0;
}