Pagini recente » Cod sursa (job #383845) | Cod sursa (job #1869745) | Algoritmul lui Dinic | Cod sursa (job #1034245) | Cod sursa (job #2193189)
#include <stdio.h>
using namespace std;
unsigned long long row;
int divider;
int main() {
freopen("pascal.in", "r", stdin);
freopen("pascal.out", "w", stdout);
scanf("%lld %d", &row, ÷r);
unsigned long long counter = 0;
unsigned long long ant = 1;
unsigned long long current = 0;
for (unsigned long long k = 0; k < row / 2; k++)
{
current = ant * (row - k) / (k + 1);
if (current % divider == 0) {
counter += 2;
}
ant = current;
}
if ( row % 2 == 0) {
if (current % divider == 0) {
counter -= 1;
}
}
printf("%lld\n", counter);
return 0;
}