F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

One hundred layer

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 2962    Accepted Submission(s): 1027


Problem Description
Now there is a game called the new man down 100th floor. The rules of this game is:
¡¡¡¡1.  At first you are at the 1st floor. And the floor moves up. Of course you can choose which part you will stay in the first time.
¡¡¡¡2.  Every floor is divided into M parts. You can only walk in a direction (left or right). And you can jump to the next floor in any part, however if you are now in part ¡°y¡±, you can only jump to part ¡°y¡± in the next floor! (1<=y<=M)
¡¡¡¡3.  There are jags on the ceils, so you can only move at most T parts each floor.
¡¡¡¡4.  Each part has a score. And the score is the sum of the parts¡¯ score sum you passed by.
Now we want to know after you get the 100th floor, what¡¯s the highest score you can get.
 

Input
The first line of each case has four integer N, M, X, T(1<=N<=100, 1<=M<=10000, 1<=X£¬ T<=M). N indicates the number of layers; M indicates the number of parts. At first you are in the X-th part. You can move at most T parts in every floor in only one direction.
Followed N lines, each line has M integers indicating the score. (-500<=score<=500)
 

Output
Output the highest score you can get.
 

Sample Input
3 3 2 1 7 8 1 4 5 6 1 2 3
 

Sample Output
29
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 09:39:29, Gzip enabled