#include using namespace std; struct stc{ int height; int penalty; int index; }; int n, b; stc sticks[1000005]; int k; int currentLen = 0; vector holes[1000005]; int main() { freopen("sticks.out", "w", stdout); freopen("sticks.in", "r", stdin); scanf("%d %d", &n, &b); for (int i = 0; i < n; ++i) { sticks[i].index = i; scanf("%d", &sticks[i].height); } for (int i = 0; i < n; ++i) { scanf("%d", &sticks[i].penalty); } for (int i = 0; i < n; i++) { if (currentLen != 0 && currentLen + sticks[i].height > b) { currentLen = 0; k++; } holes[k].push_back(sticks[i].index); currentLen += sticks[i].height; } printf("%d\n", k+1); for (int i = 0; i <= k; i++) { printf("%d ", holes[i].size()); for (int j = 0; j < holes[i].size(); j++) { printf("%d ", holes[i][j]+1); } printf("\n"); } return 0; }