Language: C++

using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Globalization;
using System.Diagnostics;
using Pair = System.Collections.Generic.KeyValuePair<int, int>;


// https://pekempey.github.io/lazy_propagation_segment_tree/lazy_propagation_segment_tree.html

class Program
{
    static void Main()
    {
        Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
        new Program().Solve();
        Console.Out.Flush();
    }
    Scanner cin = new Scanner();


    void Solve()
    {
        int n_ = cin.Nextint;
        int q = cin.Nextint;

        int n = 1;
        while (n < n_) n *= 2;

        var M = new RMQ_2(n, int.MaxValue);


        for (int i = 0; i < q; i++)
        {
            if (cin.Nextint == 0)
            {
                int s = cin.Nextint, t = cin.Nextint, x = cin.Nextint;
                M.Update(s, t + 1, x, 0, 0, n);
            }
            else
            {
                int s = cin.Nextint, t = cin.Nextint;
                Console.WriteLine(M.Find(s, t + 1, 0, 0, n));
            }
        }
    }

}

class RMQ_2
{
    int n;
    int[] mini;
    int[] lazy;


    public RMQ_2(int n, int t)
    {
        this.n = n;
        mini = Enumerable.Repeat(t, 2 * n - 1).ToArray();
        lazy = Enumerable.Repeat(-1, 2 * n - 1).ToArray();
    }

    //[a, b) update
    public void Update(int a, int b, int x, int k, int l, int r) //ue-kara
    {
        if (r <= a || b <= l) return;
        if (a <= l && r <= b) Setlazy(k, x);

        else
        {
            Push(k); //sita-he
            Update(a, b, x, k * 2 + 1, l, (l + r) / 2);
            Update(a, b, x, k * 2 + 2, (l + r) / 2, r);

            fix(k); //ue-he
        }
    }
    void fix(int k)
    {
        mini[k] = Math.Min(mini[k * 2 + 1], mini[k * 2 + 2]);
    }
 

    //[a, b) Min
    public int Find(int a, int b, int k, int l, int r) //ue-kara
    {
        if (r <= a || b <= l) return int.MaxValue;
        if (a <= l && r <= b) return mini[k];

        Push(k); //sita-he
        int vl = Find(a, b, k * 2 + 1, l, (l + r) / 2);
        int vr = Find(a, b, k * 2 + 2, (l + r) / 2, r);
        return Math.Min(vl, vr);
    }

    void Push(int k)//?????¶
    {
        if (lazy[k] == -1) return;

        Setlazy(k * 2 + 1, lazy[k]);
        Setlazy(k * 2 + 2, lazy[k]);

        lazy[k] = -1;

    }
    void Setlazy(int k, int v)//?????¶
    {
        lazy[k] = v;
        mini[k] = v;
    }

}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] Scan { get { return Console.ReadLine().Split(); } }
    public int[] Scanint { get { return Array.ConvertAll(Scan, int.Parse); } }
    public long[] Scanlong { get { return Array.ConvertAll(Scan, long.Parse); } }
    public double[] Scandouble { get { return Array.ConvertAll(Scan, double.Parse); } }
    public string Next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return Next;
        }
    }
    public int Nextint { get { return int.Parse(Next); } }
    public long Nextlong { get { return long.Parse(Next); } }
    public double Nextdouble { get { return double.Parse(Next); } }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.IO;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.Globalization;
      |       ^~~~~~
a.cc:6:7: error: expected nested-name-specifier before 'System'
    6 | using System.Diagnostics;
      |       ^~~~~~
a.cc:7:14: error: 'System' does not name a type
    7 | using Pair = System.Collections.Generic.KeyValuePair<int, int>;
      |              ^~~~~~
a.cc:20:5: error: 'Scanner' does not name a type
   20 |     Scanner cin = new Scanner();
      |     ^~~~~~~
a.cc:49:2: error: expected ';' after class definition
   49 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main()':
a.cc:16:9: error: 'Console' was not declared in this scope
   16 |         Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
      |         ^~~~~~~
a.cc:16:28: error: expected type-specifier before 'StreamWriter'
   16 |         Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
      |                            ^~~~~~~~~~~~
a.cc:17:22: error: expected ';' before '.' token
   17 |         new Program().Solve();
      |                      ^
a.cc: In member function 'void Program::Solve()':
a.cc:25:18: error: 'cin' was not declared in this scope
   25 |         int n_ = cin.Nextint;
      |                  ^~~
a.cc:31:9: error: 'var' was not declared in this scope
   31 |         var M = new RMQ_2(n, int.MaxValue);
      |         ^~~
a.cc:39:17: error: 'M' was not declared in this scope
   39 |                 M.Update(s, t + 1, x, 0, 0, n);
      |                 ^
a.cc:39:29: error: 't' was not declared in this scope
   39 |                 M.Update(s, t + 1, x, 0, 0, n);
      |                             ^
a.cc:39:36: error: 'x' was not declared in this scope
   39 |                 M.Update(s, t + 1, x, 0, 0, n);
      |                                    ^
a.cc:44:17: error: 'Console' was not declared in this scope
   44 |                 Console.WriteLine(M.Find(s, t + 1, 0, 0, n));
      |                 ^~~~~~~
a.cc:44:35: error: 'M' was not declared in this scope
   44 |                 Console.WriteLine(M.Find(s, t + 1, 0, 0, n));
      |                                   ^
a.cc:44:45: error: 't' was not declared in this scope
   44 |                 Console.WriteLine(M.Find(s, t + 1, 0, 0, n));
      |                                             ^
a.cc: At global scope:
a.cc:54:8: error: expected unqualified-id before '[' token
   54 |     int[] mini;
      |        ^
a.cc:55:8: error: expected unqualified-id before '[' token
   55 |     int[] lazy;
      |        ^
a.cc:58:11: error: expected ':' before 'RMQ_2'
   58 |     public RMQ_2(int n, int t)
      |           ^~~~~~
      |           :
a.cc:66:11: error: expected ':' before 'void'
   66 |     public void Update(int a, int b, int x, int k, int l, int r) //ue-kara
      |           ^~~~~
      |           :
a.cc:87:11: error: expected ':' before 'int'
   87 |     public int Find(int a, int b, int k, int l, int r) //ue-kara
      |           ^~~~
      |           :
a.cc:114:2: error: expected ';' after class definition
  114 | }
      |  ^
      |  ;
a.cc: In constructor 'RMQ_2::RMQ_2(int, int)':
a.cc:60:14: error: request for member 'n' in '(RMQ_2*)this', which is of pointer type 'RMQ_2*' (maybe you meant to use '->' ?)
   60 |         this.n = n;
      |              ^
a.cc:61:9: error: 'mini' was not declared in this scope
   61 |         mini = Enumerable.Repeat(t, 2 * n - 1).ToArray();
      |         ^~~~
a.cc:61:16: error: 'Enumerable' was not declared in this scope
   61 |         mini = Enumerable.Repeat(t, 2 * n - 1).ToArray();
      |                ^~~~~~~~~~
a.cc:62:9: error: 'lazy' was not declared in this scope; did you mean 'Setlazy'?
   62 |         lazy = Enumerable.Repeat(-1, 2 * n - 1).ToArray();
      |         ^~~~
      |         Setlazy
a.cc: In member function 'void RMQ_2::fix(int)':
a.cc:82:9: error: 'mini' was not declared in this scope
   82 |         mini[k] = Math.Min(mini[k * 2 + 1], mini[k * 2 + 2]);
      |         ^~~~
a.cc:82:19: error: 'Math' was not declared in this scope
   82 |         mini[k] = Math.Min(mini[k * 2 + 1], mini[k * 2 + 2]);
      |                   ^~~~
a.cc: In member function 'int RMQ_2::Find(int, int, int, int, int)':
a.cc:89:38: error: expected primary-expression before 'int'
   89 |         if (r <= a || b <= l) return int.MaxValue;
      |                                      ^~~
a.cc:89:38: error: expected ';' before 'int'
a.cc:89:41: error: expected unqualified-id before '.' token
   89 |         if (r <= a || b <= l) return int.MaxValue;
      |                                         ^
a.cc:90:38: error: 'mini' was not declared in this scope
   90 |         if (a <= l && r <= b) return mini[k];
      |                                      ^~~~
a.cc:95:16: error: 'Math' was not declared in this scope
   95 |         return Math.Min(vl, vr);
      |                ^~~~
a.cc: In member function 'void RMQ_2::Push(int)':
a.cc:100:13: error: 'lazy' was not declared in this scope; did you mean 'Setlazy'?
  100 |         if (lazy[k] == -1) return;
      |             ^~~~
      |             Setlazy
a.cc:102:28: error: 'lazy' was not declared in this scope; did you mean 'Setlazy'?
  102 |         Setlazy(k * 2 + 1, lazy[k]);
      |                            ^~~~
      |                            Setlazy
a.cc: In member function 'void RMQ_2::Setlazy(int, int)':
a.cc:110:9: error: 'lazy' was not declared in this scope; did you mean 'Setlazy'?
  110 |         lazy[k] = v;
      |         ^~~~
      |         Setlazy
a.cc:111:9: error: 'mini' was not declared in this scope
  111 |         mini[k] = v;
      |         ^~~~
a.cc: At global scope:
a.cc:118:5: error: 'string' does not name a type
  118 |     string[] s; int i;
      |     ^~~~~~
a.cc:119:9: error: expected unqualified-id before '[' token
  119 |     char[] cs = new char[] { ' ' };
      |         ^
a.cc:120:11: error: expected ':' before 'Scanner'
  120 |     public Scanner() { s = new string[0]; i = 0; }
      |           ^~~~~~~~
      |           :
a.cc:121:11: error: expected ':' before 'string'
  121 |     public string[] Scan { get { return Console.ReadLine().Split(); } }
      |           ^~~~~~~
      |           :
a.cc:121:12: error: 'string' does not name a type
  121 |     public string[] Scan { get { return Console.ReadLine().Split(); } }
      |            ^~~~~~
a.cc:122:11: error: expected ':' before 'int'
  122 |     public int[] Scanint { get { return Array.ConvertAll(Scan, int.Parse); } }
      |           ^~~~
      |           :
a.cc:122:15: error: expected unqualified-id before '[' token
  122 |     public int[] Scanint { get { return Array.ConvertAll(Scan, int.Parse); } }
      |               ^
a.cc:123:11: error: expected ':' before 'long'
  123 |     public long[] Scanlong { get { return Array.ConvertAll(Scan, long.Parse); } }
      |           ^~~~~
      |           :
a.cc:123:16: error: expected unqualified-id before '[' token
  123 |     public long[] Scanlong { get { return Array.ConvertAll(Scan, long.Parse); } }
      |                ^
a.cc:124:11: error: expected ':' before 'double'
  124 |     public double[] Scandouble { get { return Array.ConvertAll(Scan, double.Parse); } }
      |           ^~~~~~~
      |           :
a.cc:124:18: error: expected unqualified-id before '[' token
  124 |     public double[] Scandouble { get { return Array.ConvertAll(Scan, double.Parse); } }
      |                  ^
a.cc:125:11: error: expected ':' before 'string'
  125 |     public string Next
      |           ^~~~~~~
      |           :
a.cc:125:12: error: 'string' does not name a type
  125 |     public string Next
      |            ^~~~~~
a.cc:137:11: error: expected ':' before 'int'
  137 |     public int Nextint { get { return int.Parse(Next); } }
      |           ^~~~
      |           :
a.cc:137:58: error: expected ';' at end of member declaration
  137 |     public int Nextint { get { return int.Parse(Next); } }
      |                                                          ^
      |                                                           ;
a.cc:138:11: error: expected ':' before 'long'
  138 |     public long Nextlong { get { return long.Parse(Next); } }
      |           ^~~~~
      |           :
a.cc:138:61: error: expected ';' at end of member declaration
  138 |     public long Nextlong { get { return long.Parse(Next); } }
      |                                                             ^
      |                                                              ;
a.cc:139:11: error: expected ':' before 'double'
  139 |     public double Nextdouble { get { return double.Parse(Next); } }
      |           ^~~~~~~
      |           :
a.cc:139:67: error: expected ';' at end of member declaration
  139 |     public double Nextdouble { get { return double.Parse(Next); } }
      |                                                                   ^
      |                                                                    ;
a.cc:140:2: error: expected ';' after class definition
  140 | }
      |  ^
      |  ;
a.cc:137:26: error: 'get' was not declared in this scope
  137 |     public int Nextint { get { return int.Parse(Next); } }
      |                          ^~~
a.cc:137:30: error: expected '}' before '{' token
  137 |     public int Nextint { get { return int.Parse(Next); } }
      |                              ^
a.cc:137:24: note: to match this '{'
  137 |     public int Nextint { get { return int.Parse(Next); } }
      |                        ^
a.cc:137:30: error: cannot convert '<brace-enclosed initializer list>' to 'int' in initialization
  137 |     public in