Company: TBO_3july

Difficulty: hard

Problem Statement

Tech Club There are `K × K` students. Student `(r,c)` has Mathematics skill `r` and Physics skill `c`, where both values are from `0` through `K-1`. Count the number of committees containing exactly `N` students such that for every pair of selected students: their Mathematics skills differ; their Physics skills differ; the absolute Mathematics difference is not equal to the absolute Physics difference. The last rule prevents two selected cells from lying on the same diagonal of the skill grid. Input Read two integers `N K`. Output Print the number of valid committees modulo `1,000,000,007`. Notes `1 ≤ N ≤ K ≤ 8`. A committee is unordered, so selecting the same students in a different order does not create another committee.

More TBO_3july OA questionsInterview experiences