#include #include using namespace std; #define MAX (1<<12) vector pos[MAX]; int f = -1; int n = -1; bool overflow = false; void emit(int v) { ++n; if (v