Language: C++

#include<bits/stdc++.h>
using namespace std;

int data[12][13];

int main(){
	int n,m,x;	cin>>n>>m>>x;
	for(int i=0;i<n;i++){
		for(int j=0;j<=m;j++)cin>>data[i][j];
	}


	int ans=1000000000;
	for(int flag=0; flag<(1<<n); flag++){
		vector<int> sum(13,0);
		for(int i=0; i<n; i++){
			if((flag>>i)&1){
				for(int j=0;j<=m;j++){
					sum[j]+=data[i][j];
				}
			}
		}

		bool can=true;
		for(int i=1;i<=m;i++){
			if(sum[i]<x){
				can=false;	break;
			}
		}

		if(can)ans=min(ans,sum[0]);
	}
	if(ans==1000000000)cout<<-1<<endl;
	else cout<<ans<<endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:43: error: reference to 'data' is ambiguous
    9 |                 for(int j=0;j<=m;j++)cin>>data[i][j];
      |                                           ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:4:5: note:                 'int data [12][13]'
    4 | int data[12][13];
      |     ^~~~
a.cc:19:49: error: reference to 'data' is ambiguous
   19 |                                         sum[j]+=data[i][j];
      |                                                 ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:4:5: note:                 'int data [12][13]'
    4 | int data[12][13];
      |     ^~~~