hiho week 148 register

Ended

Participants:382

Verdict:Accepted
Score:100 / 100
Submitted:2017-05-01 22:09:04

Lang:Java

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int T = cin.nextInt(), NPWHSa[], lastS;
        for (int i = 0i < Ti++) {
            N = cin.nextInt();
            P = cin.nextInt();
            W = cin.nextInt();
            H = cin.nextInt();
            S = 1;
            lastS = 1;
            a = new int[N];
            for (int j = 0j < Nj++) {
                a[j= cin.nextInt();
            }
            boolean flag = true;
            while (flag) {
                lastS = S++;
                int col = W / Srow = H / SmaxLine = P * rowline = 0;
                for (int j = 0j < Nj++) {
                    if (col == 0 || row == 0) {
                        flag = false;
                        break;
                    }
                    line += (intMath.ceil(((floata[j]) / col);
                }
                if (line > maxLine)
                    break;
            }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX