Language: C++

#include<iostream>
using namespace std;
int sum[20], a[20][20],n,m,k,c[20];
int min = 2147483647;
void check(int t) {
	for (int i = 0; i < m; i++) {
		if (sum[i] < k) return;
	}
	if (t < min) min = t;
}
void work(int dep,int t) {
	if (t > min) return;
	if (dep >= n) {
		check(t); return;
	}
	for (int i = 0; i < m; i++)
		sum[i] += a[dep][i];
	work(dep + 1, t + c[dep]);
	for (int i = 0; i < m; i++)
		sum[i] -= a[dep][i];
	work(dep + 1, t);
}
int main() {
	cin >> n >> m >> k;
	for (int i = 0; i < n; i++) {
		cin >> c[i];
		for (int j = 0; j < m; j++)
			cin >> a[i][j];
	}

	work(0,0);
	if (min == 2147483647) cout << -1 << endl; else  cout << min << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void check(int)':
a.cc:9:17: error: reference to 'min' is ambiguous
    9 |         if (t < min) min = t;
      |                 ^~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:4:5: note:                 'int min'
    4 | int min = 2147483647;
      |     ^~~
a.cc:9:22: error: reference to 'min' is ambiguous
    9 |         if (t < min) min = t;
      |                      ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:4:5: note:                 'int min'
    4 | int min = 2147483647;
      |     ^~~
a.cc: In function 'void work(int, int)':
a.cc:12:17: error: reference to 'min' is ambiguous
   12 |         if (t > min) return;
      |                 ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:4:5: note:                 'int min'
    4 | int min = 2147483647;
      |     ^~~
a.cc: In function 'int main()':
a.cc:32:13: error: reference to 'min' is ambiguous
   32 |         if (min == 2147483647) cout << -1 << endl; else  cout << min << endl;
      |             ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:4:5: note:                 'int min'
    4 | int min = 2147483647;
      |     ^~~
a.cc:32:66: error: reference to 'min' is ambiguous
   32 |         if (min == 2147483647) cout << -1 << endl; else  cout << min << endl;
      |                                                                  ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:4:5: note:                 'int min'
    4 | int min = 2147483647;
      |     ^~~