#include <fstream>
#ifndef MAX
#define MAX(a,b) a>b?a:b
#endif
using namespace std;
ifstream cin("books.in");
ofstream cout("books.out");
int m,k;
int a[502];
int cyf()
{
int i,j,l = 0,r = 0;
cin >> m >> k;
for (i = 1; i <= m; ++i)
{
cin >> a[i];
r += a[i];
l = MAX(a[i],l);
/* code */
}
a[m+1] = 999999999;
while(l < r)
{
int mid = (l+r)/2,w = 0,sum = 0;
for (int i = 1; i < m; ++i)
{
w += a[i];
if (w + a[i+1] > mid)
{
sum++;
w = 0;
/* code */
}
/* code */
}
if (sum < k)
{
r = mid;
/* code */
}
else
{
l = mid + 1;
}
}
//cout << l << endl;
int w = 0,sum = 0;
int t1 = 1,t2;
for (i = 1; i <= m; ++i)
{
w += a[i];
if (w + a[i+1] > l)
{
cout << t1 << ' ' << i << endl;
t1 = i+1;
w = 0;
/* code */
}
/* code */
}
cin.close();
cout.close();
return 0;
}
int hhhh = cyf();
int main() {;}