Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long int ll;
- typedef unsigned long long int ull;
- typedef vector<int> vi;
- typedef vector<vi> vvi;
- typedef pair<int,int> pii;
- typedef vector< pii > vpii;
- typedef set<int> sti;
- #define pb push_back
- #define pob pop_back
- #define mp make_pair
- #define ff first
- #define ss second
- #define loop1(i,n) for(int i=1; i<=int(n); i++)
- #define loop(i,y) for(int i=0; i<int(y); i++)
- #define rloop(i,y) for(int i=int(y)-1; i>=0; i--)
- #define read() freopen("input.txt", "r", stdin)
- #define write() freopen("output.txt", "w", stdout)
- #define cspf(i) printf("Case %d: ", i)
- /// Constants
- #define eps 1e-9
- #define PI acos(-1.0) // 3.1415926535897932
- int main()
- {
- read();
- int T,R,H;
- while(scanf("%d %d %d",&T,&R,&H)!=EOF){
- int t[110][110],r[110][110],h[110][110];
- int i,j,k,l,m,n,o,p,total,tl;
- for(i=0;i<T;i++){
- for(j=0;j<R+1;j++)
- scanf("%d",&t[i][j]);
- }
- for(i=0;i<R;i++){
- for(j=0;j<H+1;j++)
- scanf("%d",&r[i][j]);
- }
- for(i=0;i<H;i++){
- for(j=0;j<T+1;j++)
- scanf("%d",&h[i][j]);
- }
- int mn=99999999,x,y,z;
- for(i=0;i<T;i++){
- for(j=1;j<R+1;j++){
- if(t[i][j]==0){
- for(k=1;k<H+1;k++){
- if(r[j-1][k]==0){
- if(h[k-1][i+1]==0){
- total=t[i][0]+r[j-1][0]+h[k-1][0];
- if(total<mn){
- mn=total;
- x=i;
- y=j-1;
- z=k-1;
- }
- }
- }
- }
- }
- }
- }
- if(mn==99999999)
- printf("Don't get married!\n");
- else
- printf("%d %d %d:%d\n",x,y,z,mn);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement