#include <bits/stdc++.h>   using namespace std;   int main() {     int nump;     int arr[7];     scanf( %d , &nump);     scanf( %d , &arr[0]);     for (int i = 1; i < 7; i++) {       scanf( %d , &arr[i]);       arr[i] += arr[i - 1];     }     int tmp = (nump / arr[6]), idx = 0;     if (tmp && arr[6] * tmp >= nump)       tmp = (tmp - 1) * arr[6];     else       tmp *= arr[6];     while (tmp + arr[idx] < nump) idx++;     printf( %d n , idx + 1);     return 0;   }   