Language: C++

import std.stdio; // readln
import std.array; // split
import std.conv; // to
import std.typecons;
import std.range;
import std.algorithm;

void main(){
	string[] s = split(readln());
	int n = to!int(s[0]);
	int k = to!int(s[1]);

	alias Tuple!(int,int) pair;
	pair[] p = new pair[](n);
	for(int i = 0; i < n; i++){
		s = split(readln());
		int a = to!int(s[0]);
		int b = to!int(s[1]);
		p[i] = pair(a,b);
	}

	sort(p);

	int cur = 0;
	for(int i = 0; i < n; i++){
		cur += p[i][1];
		if(cur >= k){
			writeln(p[i][0]);
			return;
		}
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import std.stdio; // readln
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import std.array; // split
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import std.conv; // to
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import std.typecons;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import std.range;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
    6 | import std.algorithm;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:1: error: '::main' must return 'int'
    8 | void main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'string' was not declared in this scope
    9 |         string[] s = split(readln());
      |         ^~~~~~
a.cc:9:16: error: expected primary-expression before ']' token
    9 |         string[] s = split(readln());
      |                ^
a.cc:10:17: error: 'to' was not declared in this scope
   10 |         int n = to!int(s[0]);
      |                 ^~
a.cc:13:9: error: 'alias' was not declared in this scope
   13 |         alias Tuple!(int,int) pair;
      |         ^~~~~
a.cc:14:9: error: 'pair' was not declared in this scope
   14 |         pair[] p = new pair[](n);
      |         ^~~~
a.cc:14:14: error: expected primary-expression before ']' token
   14 |         pair[] p = new pair[](n);
      |              ^
a.cc:16:17: error: 's' was not declared in this scope
   16 |                 s = split(readln());
      |                 ^
a.cc:16:27: error: 'readln' was not declared in this scope
   16 |                 s = split(readln());
      |                           ^~~~~~
a.cc:16:21: error: 'split' was not declared in this scope
   16 |                 s = split(readln());
      |                     ^~~~~
a.cc:19:17: error: 'p' was not declared in this scope
   19 |                 p[i] = pair(a,b);
      |                 ^
a.cc:22:14: error: 'p' was not declared in this scope
   22 |         sort(p);
      |              ^
a.cc:22:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   22 |         sort(p);
      |         ^~~~
      |         short
a.cc:28:25: error: 'writeln' was not declared in this scope
   28 |                         writeln(p[i][0]);
      |                         ^~~~~~~
a.cc:29:25: error: return-statement with no value, in function returning 'int' [-fpermissive]
   29 |                         return;
      |                         ^~~~~~