Task: Program Execution
Input (English): N, d, B, d, 4667, Q, 7201, 3811, D, 8023, k, 1379, 8721, 3527, 6125, e, n, 2509
Output (English): 45963