#include #include #include #include typedef int32_t i32; typedef int64_t i64; void run (void) { i32 n, m; scanf ("%" SCNi32 "%" SCNi32, &n, &m); i32 *a = (i32 *) calloc (n, sizeof (i32)); for (i32 i = 0; i < n; ++i) { scanf ("%" SCNi32, a + i); } i32 l = 0; while (l < n) { if (a[l] % 2 == 0) { l++; continue; } i64 sum = a[l]; i32 r = l + 1; while (r < n && a[r] % 2 == 1) { sum += a[r++]; } if (r - l >= m) { printf ("%" PRIi64 "\n", sum); } l = r; } } void solve (void) { i32 n, m; scanf ("%" SCNi32 "%" SCNi32, &n, &m); if (n >= m) { puts("0"); return; } i32 ans = 1; while (n > 0) { ans = (i64) ans * n-- % m; } printf ("%" PRIi32 "\n", ans); } int main (void) { solve(); //run (); return 0; }