Description This puzzle consists of a random sequence of m black disks and n white disks on an oval-shaped track, with a turnstile capable of flipping (i.e., reversing) three consecutive disks. In Figure 1, there are 8 black disks and 10 white disks…
#include <iostream> using namespace std; int main() { //freopen("acm.acm","r",stdin); int test; int n; int i; int p; int o; int e; cin>>test; while(test --) { o = ; e = ; cin>>n; == ) { ; i <= n; ++ i) { cin>>…