One question is split the array. find the a way to cut an array with minimum cuts and every subarray has a gcd larger than 1.
Sigiloso
Simple Greedy Should Work vector> split(vector& A) { vector> ans{vector{A[0]}}; int curgcd = A[0]; for (int i = 1; i ()); } ans.back().push_back(A[i]); } return ans; }