hiho week 148 register

Ended

Participants:382

Verdict:Accepted
Score:100 / 100
Submitted:2017-04-29 20:03:14

Lang:G++

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
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <queue>
using namespace std;
int task;
int w,h,p;
int n;
int a[1001] = {0};
int main()
{
    cin >> task;    
    for(int z = 1; z <= task; z++)
    {
        cin >> n >> p >> w >> h;
        for(int i = 1; i <= n; i++)
            cin >> a[i];
        int l = 1;
        int r = min(w,h);
        int mid;
        int last;
        while(l <= r)
        {
            mid = (l + r) / 2;
            int line = h / mid;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX