stove.cpp: In function 'int main()':
stove.cpp:10:17: error: 'n' was not declared in this scope
for(int i=0; i<n; ++i) scanf("%d", &t[i]);
^
stove.cpp:11:14: error: 'n' was not declared in this scope
int res = t[n - 1] + 1 - t[0];
^
stove.cpp:14:17: error: 'k' was not declared in this scope
for(int i=0; i<k-1; ++i) res -= a[i];
^
stove.cpp:9:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d", &N, &K);
~~~~~^~~~~~~~~~~~~~~~~
stove.cpp:10:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(int i=0; i<n; ++i) scanf("%d", &t[i]);
~~~~~^~~~~~~~~~~~~