#include <iostream> #include <cstring> using namespace std; int main() { cin.sync_with_stdio(false), cin.tie(0); int amount, multiple, scores, sums = 0, haveSum[100001], i; bool have = false; cin >> amount >> multiple; memset(haveSum, -1, sizeof(haveSum)), haveSum[0] = 0; for (i = 1; i <= amount; i++) { cin >> scores; sums = (sums + scores % multiple) % multiple; if (haveSum[sums] != -1) { cout << i - haveSum[sums] << '\n' << haveSum[sums] + 1; for (int j = haveSum[sums] + 2; j <= i; j++) cout << ' ' << j; cout << '\n'; break; } haveSum[sums] = i; } for (i++; i <= amount; i++) cin >> scores; }