#include "bits/stdc++.h" #define int long long #define dick vector #define full(a) a.begin(), a.end() using namespace std; using vi = vector; using vvi = vector; using pii = pair; #define V vector #define Vi = V #define all(a) a.begin(), a.end() #define forn(i, n) for(int i=0; i> a(3); for(int i = 0; i<3; i++) { cin>>a[i].first>>a[i].second; } double mn = INT_MAX, mi = -1; for(int i = 0; i<3; i++) { pii other1 = a[(i+1) % 3]; pii other2= a[(i+2) % 3]; if(dist(other1.first - a[i].first, other2.second - a[i].second) < mn) { mn = dist(other1.first - a[i].first, other2.second - a[i].second); mi = i; } if(dist(other2.first - a[i].first, other1.second - a[i].second) < mn) { mn = dist(other2.first - a[i].first, other1.second - a[i].second); mi = i; } } cout<> a(3); for(int i = 0; i<3; i++) { cin>>a[i].first>>a[i].second; } double mn = INT_MAX, mi = -1; int precision = 10000; for(int i = -100 * precision; i <= 100*precision; i++) { for(int j = -100 * precision; i<= 100 * precision; i++) { double x = i*1.0/precision; double y = j*1.0/precision; for(int i = 0; i<3; i++) { pii other1 = a[(i+1) % 3]; pii other2= a[(i+2) % 3]; if(dotP(other1.first - x, other1.second - y, other2.first - x, other2.second - y) != 0) continue; if(dist2(x - a[i].first, y - a[i].second) < mn) { mn = dist2(x - a[i].first, y - a[i].second); mi = i; } } } } cout<>n>>q; dick a(n); for(int i =0 ;i < n ;i ++){ cin>>a[i]; } dick b(n); dick c(n); for(int i = 1;i < n ;i ++){ if( a[i] < a[i-1] )b[i] =-1; } for(int i = 1 ;i < n;i++){ c[i] = c[i- 1] + b[i]; } while(q--){ int r, l; cin>>r>> l; r--;l --; if(c[r] - c[l] != 0 ){ cout<< "NO\n"; } else cout<< "YES\n"; } return; } void solveS() { int n; cin >> n; array bs = {0}; forn(i, n) { int a; cin >> a; for(int j=0; a; j++, a/=2) { bs[j] += a&1; } } unsigned long long res = 0; for(int j=0; j<64; j++) { if(bs[j]) { res |= ((unsigned long long)1) << j; } bs[j+1] += bs[j] / 2; } cout << res; } void trains () { int n , m, t; cin>>n>>m>>t; for(int k =0 ;k < m ;k ++){ int p , s, l; string d; cin>>p>>s>>d>>l; int dist = t * s; int st, ed ; if(d == "R"){ st= p + dist; ed = st + l - 1; // if( st < ed)swap(st, ed); } else { st= p -dist; ed = st + l -1 ; } string res(n, '='); for(int i= 0 ;i < n ;i ++){ if(i == st ){ res[i] = '!'; } else if ( i >= min ( st, ed) && i <= max(st, ed)){ res[i] = '#'; } else res[i] = '='; } cout<< res << '\n'; } return ; } int xin() { int n; cin>>n; return n; } using vvpii=vector>>; #define pb push_back int timer = 0; using vb=vector; void dfs(int n, vvpii& g, int v, int c1, int c2, vi& used, int p = -1) { used[v] = ++timer; for(auto& to : g[v]) { if(to.first == p) continue; if(used[to.first] && used[to.first] < used[v]) { if(c1 + (to.second == 0) == 0 && c2 + (to.second == 1) == 0) { continue; } if(c1 + (to.second == 0) >= 2 && c2 + (to.second == 1) >= 2) { continue; } cout<<"NO"<