#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned int UInt; #define ALL(a) (a).begin(), (a).end() #define FOR(i,a,b) for(int i = a; i < (int)(b); ++i) #define FOR_REV(i,a,b) for(int i = b-1; i >= (int)(a); --i) #define FOR_EACH(it,a) for(remove_reference::type::iterator it = (a).begin(); it != (a).end(); ++it) #define FOR_EACH_CONST(it,a) for(remove_reference::type::const_iterator it = (a).begin(); it != (a).end(); ++it) #define IN_INT(a) int a; is >> a; #define IN_INT2(a,b) int a,b; is >> a >> b; #define IN_INT3(a,b,c) int a,b,c; is >> a >> b >> c; template inline T sqr(T v) { return v * v; } template inline int sign(T v) {return v == 0 ? 0 : (v > 0 ? 1 : -1);} template int get_bit(T v, int bit_index) { return (v >> bit_index) & 1; } //return {0,1} istream& input() { ios_base::sync_with_stdio(false); //#undef INPUT_FROM_FILE #ifdef INPUT_FROM_FILE static ifstream is("HackerRank/input.txt"); #else istream& is = cin; #endif return is; } ostream& output() { cout << setprecision(15); return cout; } ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// vector minc(100001,-1); int get_min(int l) { if (l<=1) return 0; if (minc[l]>=0) return minc[l]; int res=l-1; res+=get_min((l-1)/2)+get_min((l)/2); minc[l]=res; return res; } int get_max(int l) {return l*(l-1)/2;} void out(ostream& os, int a0, int a1, int c) { if (a0==a1) return; if (a0+1==a1) { os<=c) { os<m1) os<<"-1"; else { out(os,1,l+1,c); } os << "\n"; } return 0; } ////////////////////////////////////////////////////////////////////////// //int main() //{ // istream& is = input(); // ostream& os = output(); // // int n; // is >> n; // vector a(n); // FOR (i,0,n) // is >> a[i]; // // //int res = 0; // //os << res; // //os << "\n"; // // return 0; //}