Nộp bài | Các bài nộp | Làm tốt nhất | Về danh sách bài |
HELPPM - Help the PM! |
English | Vietnamese |
In 2050, Le Don Khue has become the Prime Minister of Vietnam. He has to consider a logging plan of K m3 wood in a forest for export. The forest is a MxN km2 rectangular area. For easy management, the forest is divided into MxN cells (M rows and N columns). The rows are numbered as 1 to M from top to bottom. The columns are numbered as 1 to N from left to right. The cell at row i and column j has coordinates (i, j). The quantity of wood (m3) in each cell is already known. The PM decided to give permission for logging. The logging area should also be rectangular. The PM wants to find an area as small as possible but there is still enough wood in this area for export. Has not been programming for a long time, the PM needs your help. Let's help him! |
Input
- The first line contains three integers M, N, K (1 ≤ M, N ≤ 500, 1 ≤ K ≤ 109).
- The ith line in the next M lines contains N non-negative integers in which the jth number is the quantity of wood in cell (i, j). The quantity of wood in each cell is not larger than 104 m3.
Output
If there is no logging area that give enough wood for export, print -1. Otherwise, print two lines:
- The first line contains the minimum possible area of the logging area.
- The second line contains four integers that are coordinates of the top left and bottom right corner of the logging area. If there is more than one possible area, print the coordinates of any of them.
Example
Input 3 3 19 5 4 0 4 7 0 0 0 2 Output 4 1 1 2 2
Được gửi lên bởi: | Lê Đôn Khuê |
Ngày: | 2008-07-18 |
Thời gian chạy: | 1s |
Giới hạn mã nguồn: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Ngôn ngữ cho phép: | ADA95 ASM32 BASH BF C CSHARP CPP C99 CLPS LISP sbcl LISP clisp D FORTRAN HASK ICON ICK JAVA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON RUBY SCM guile SCM qobi ST TEXT WHITESPACE |
Nguồn bài: | VNOI Marathon '08 - Round 6/DivB Problem Setter: Lê Đôn Khuê |
hide comments
2020-02-27 10:04:50
sao nộp lại gặp lỗi vậy? |
|
2014-12-27 04:30:18 blueBUBBLE
bài này làm s? |