2012年7月6日金曜日

AOJ Volume2 0217: Walking in the Hospital

/****************************************
*    2012/06/30                            *
*    AOJ Volume2 0217                    *
*        Walking in the Hospital            *
*   crane                                *
*****************************************/

#include<iostream>
using namespace std;

int main(){
    int n;    //データ数
   
    while(cin >> n, n){
        int p, d1, d2;
        int m_p=0, md=0;
        for(int i=0; i<n; i++){
            cin >> p >> d1 >> d2;
            if(d1+d2 > md){
                m_p = p;
                md = d1 + d2;
            }
        }

        cout << m_p << " " << md << endl;
    }
    return 0;
}

0 件のコメント:

コメントを投稿