Language: C++

#include <iostream>
#include <sstream>
struct Scanner {
  std::string pp(const char ch) {
    if (ch == EOF) {
      return "EOF";
    } else {
      return std::string(1, ch);
    }
  }#include <iostream>
#include <sstream>
struct Scanner {
  std::string pp(const char ch) {
    if (ch == EOF) {
      return "EOF";
    } else {
      return std::string(1, ch);
    }
  }
  void readSpace() {
    auto ch = getchar();
    if (ch != ' ') {
      throw std::runtime_error(std::string("want: Space, got: ") + pp(ch));
    }
  }
  void readNewline() {
    auto ch = getchar();
    if (ch != '\n') {
      throw std::runtime_error(std::string("want: Newline, got: ") + pp(ch));
    }
  }
  void readEof() {
    auto ch = getchar();
    if (ch != EOF) {
      throw std::runtime_error(std::string("want: EOF, got: ") + pp(ch));
    }
  }
  std::string readString() {
    std::string ret;
    char ch;
    while (ch = getchar(), ch != ' ' and ch != '\n' and ch != EOF) {
      ret += ch;
    }
    ungetc(ch, stdin);
    return ret;
  }
  template <typename T>
  T readInt(T lb, T ub) {
    char ch = getchar();
    if ((not isdigit(ch)) and (ch != '-')) {
      ungetc(ch, stdin);
      throw std::runtime_error(std::string("want: [0-9\\-]+, got: ") + pp(ch));
    }
    T ret = ch == '-' ? 0 : ch - '0';
    int sgn = ch == '-' ? -1 : +1;
    while (isdigit(ch = getchar())) {
      ret = ret * 10 + (ch - '0');
    }
    ungetc(ch, stdin);
    ret *= sgn;
    if (not(lb <= ret and ret <= ub)) {
      std::ostringstream os;
      os << ret << " is not in [" << lb << ", " << ub << "]";
      throw std::runtime_error(os.str());
    }
  }
};

using namespace std;
int main() {
  Scanner sc;
  auto a = sc.readInt<int>(1, 20);
  sc.readSpace();
  auto b = sc.readInt<int>(1, a);
  sc.readSpace();
  auto c = sc.readInt<int>(1, 20);
  // sc.readNewline();
  // sc.readEof();
  cout << -1 << endl;
  return 0;
}

  void readSpace() {
    auto ch = getchar();
    if (ch != ' ') {
      throw std::runtime_error(std::string("want: Space, got: ") + pp(ch));
    }
  }
  void readNewline() {
    auto ch = getchar();
    if (ch != '\n') {
      throw std::runtime_error(std::string("want: Newline, got: ") + pp(ch));
    }
  }
  void readEof() {
    auto ch = getchar();
    if (ch != EOF) {
      throw std::runtime_error(std::string("want: EOF, got: ") + pp(ch));
    }
  }
  std::string readString() {
    std::string ret;
    char ch;
    while (ch = getchar(), ch != ' ' and ch != '\n' and ch != EOF) {
      ret += ch;
    }
    ungetc(ch, stdin);
    return ret;
  }
  template <typename T>
  T readInt(T lb, T ub) {
    char ch = getchar();
    if ((not isdigit(ch)) and (ch != '-')) {
      ungetc(ch, stdin);
      throw std::runtime_error(std::string("want: [0-9\\-]+, got: ") + pp(ch));
    }
    T ret = ch == '-' ? 0 : ch - '0';
    int sgn = ch == '-' ? -1 : +1;
    while (isdigit(ch = getchar())) {
      ret = ret * 10 + (ch - '0');
    }
    ungetc(ch, stdin);
    ret *= sgn;
    if (not(lb <= ret and ret <= ub)) {
      std::ostringstream os;
      os << ret << " is not in [" << lb << ", " << ub << "]";
      throw std::runtime_error(os.str());
    }
  }
};

using namespace std;
int main() {
  Scanner sc;
  auto a = sc.readInt<int>(1, 20);
  sc.readSpace();
  auto b = sc.readInt<int>(1, a);
  sc.readSpace();
  auto c = sc.readInt<int>(1, 20);
  sc.readNewline();
  sc.readEof();
  cout << -1 << endl;
  return 0;
}


Compiler output:
a.cc:10:4: error: stray '#' in program
   10 |   }#include <iostream>
      |    ^
a.cc:10:5: error: 'include' does not name a type
   10 |   }#include <iostream>
      |     ^~~~~~~
a.cc:69:7: error: expected nested-name-specifier before 'namespace'
   69 | using namespace std;
      |       ^~~~~~~~~
a.cc: In member function 'int Scanner::main()':
a.cc:79:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   79 |   cout << -1 << endl;
      |   ^~~~
      |   std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:79:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   79 |   cout << -1 << endl;
      |                 ^~~~
      |                 std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc: In member function 'T Scanner::readInt(T, T) [with T = int]':
a.cc:129:3: warning: control reaches end of non-void function [-Wreturn-type]
  129 |   }
      |   ^