HEU 1020 Ferry Loading II

/**************************************
Problem: HEU 1020 Ferry Loading II
Time: 0.0000 s
Memory: 528 k 
Accepted Time: 2009-04-24 16:28:39
Tips: 别人的再好,也不是自己的!//
http://hi.baidu.com/pk_kailu_v/blog/item/ee377a4fc6cf7335afc3abf3.html
*************************************
*/

#include 
<stdio.h>
#include 
<stdlib.h>
int main()
{
    
int Case,n,t,m,i,j,k,s,ti;
    scanf(
"%d",&Case);
    
while(Case--)
    
{
       scanf(
"%d%d%d",&n,&t,&m);
       k
=m/n;s=m%n;ti=0;
       
if(s)++k;
       
while(s--)
       
{
       scanf(
"%d",&i);
        ti
=i+2*t;
       }

       
for(i=0;i<m/n;++i)
       
{
        
for(j=0;j<n;++j)
        scanf(
"%d",&s);
        
if(ti<s)ti=s;
        ti
+=2*t;
       }

        printf(
"%d %d\n",ti-t,k);
    }

    
//system("pause");
    return 0;
}


posted @ 2009-04-24 17:12  主函数  阅读(249)  评论(0编辑  收藏  举报