Easy25 pts
Lisa's Workbook
Lisa's workbook: n chapters, chapter i has arr[i] problems. Each page holds k problems. A special problem has its problem number (within chapter) equal to the page number. Count special problems. Example: n=5, k=3, arr=[4,2,6,1,10]. Chapter 1: problems 1-4 on pages 1-2. Problem 1 on page 1 (special), problem 4 on page 2 (special). Continue for all chapters.
Input
First line: n k (space-separated). Second line: n space-separated integers (problems per chapter).
Output
A single integer: the count of special problems.
Sample
5 3 4 2 6 1 10
Expected
4
Loading editor…
Output
No output yet. Run your code to see results.