#include #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; int f(int n,int m,int x){ if(x%(2*m)