1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include <cmath>

using namespace std;

int n, k;
int t[2001][2001], miny[2001];
int main()
{
    cin >> n >> k;
    int mini = 3000;
    for (int i = 0; i < n; i++)
    {
        //cin >> t[i][0];

        for (int j = 0; j < i + 1; j++)
        {
            cin >> t[i][j];
            mini = min(mini, t[i][j]);
        }
        miny[i] = mini;
    }
    float d = 1 + 4 * 2 * k;
    float k2 = (-1 - sqrt(d)) / 2;
    int p = (int)k2;
    while ((1 + p) / 2 * p < k)
        p++;
    cout << miny[p - 1];
}