• + 0 comments
    int count = 0, p_r_p_c = 1; //p_r_p_c = page required per chapter
        for(int i = 0; i< arr.size();i++){
            int n = 1;
            while(n <= arr[i]){
                if(n == p_r_p_c) count++;
                
                if(n%k == 0 && n != arr[i]) p_r_p_c++;
                
                n++;
            }
            p_r_p_c++;
        }
        return count;