// (⁠◕⁠ᴗ⁠◕⁠✿⁠) #include #define rep(i, n) for (ll i = 0; i < (n); i++) #define srep(i, s, n) for (ll i = s; i < (n); i++) #define len(x) ((int)(x).size()) #define all(x) (x).begin(), (x).end() using namespace std; template using vc = vector; template using vv = vc>; using vi = vc;using vvi = vv; using vvvi = vv; using ll = long long;using vl = vc;using vvl = vv; using vvvl = vv; using ld = long double; using vld = vc; using vvld = vc; using vvvld = vc; using uint = unsigned int; using ull = unsigned long long; const ld pi = 3.141592653589793; const int inf = 0x3f3f3f3f; const ll INF = 0x3f3f3f3f3f3f3f3f; // const ll mod = 1000000007; const ll mod = 998244353; inline bool inside(long long y, long long x, long long H, long long W) {return 0 <= (y) and (y) < (H) and 0 <= (x) and (x) < (W); } #define debug(var) do{std::cout << #var << " : \n";view(var);}while(0) template void view(T e){cout << e << endl;} template void view(const vc& v){for(const auto& e : v){ cout << e << " "; } cout << endl;} template void view(const vv& vv){ for(const auto& v : vv){ view(v); } } int op1(int a, int b){return a + b;}; int e1(){return 0;}; ld op2(ld a, ld b){return a + b;}; ld e2(){return 0;}; template struct segtree{ public : segtree(int n) : _n(n){ depth = 0; while ((1 << depth) < _n) depth++; size = 1 << depth; tree = vc(2 * size, e()); } void set(int p, T x){ assert (0 <= p && p < _n); p += size; tree[p] = x; for (int i = 0; i < depth; i++){ p >>= 1; tree[p] = op(tree[2 * p], tree[2 * p + 1]); } return; } T get(int p){ assert(0 <= p && p < _n); return tree[p + size]; } T prod(int l, int r){ assert (0 <= l && l < r && r <= _n); T nl = e(), nr = e(); l += size; r += size; while(l < r){ if (l & 1) nl = op(nl, tree[l++]); if (r & 1) nr = op(nr, tree[--r]); l >>= 1; r >>= 1; } return op(nl, nr); } private : int _n, depth, size; vc tree; }; int main(){ int N, Q; cin >> N >> Q; vv> query(N); segtree seg1(100100); rep(i, Q){ int id, s, t; cin >> id >> s >> t; id--; query[id].push_back({s, t}); seg1.set(s, seg1.get(s) + 1); seg1.set(t, seg1.get(t) - 1); } segtree seg2(100100); rep(i, 100010) seg2.set(i, (ld)1 / (ld)seg1.prod(0, i + 1)); vld ret(N); rep(i, N) for (auto [s, t] : query[i]) ret[i] += seg2.prod(s, t); for (auto x : ret) cout << fixed << setprecision(16) << x << endl; }