sequence.cpp: In function 'long long int solve(std::vector<int>, int, bool)':
sequence.cpp:21:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int j=0, k=i; j<S.size(); j++, k++, k%=10) {
~^~~~~~~~~
sequence.cpp: In function 'int main()':
sequence.cpp:34:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
int K; scanf("%d",&K);
~~~~~^~~~~~~~~
sequence.cpp:36:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
int foo; scanf("%d",&foo);
~~~~~^~~~~~~~~~~