hiho week 216 register

Ended

Participants:197

Verdict:Accepted
Score:100 / 100
Submitted:2018-08-20 23:56:26

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<bits/stdc++.h>
#define maxn 1010
using namespace std;
double a[maxn];
int n;
double m,k;
bool check(double x)
{
    //cout<<x<<" ";
    double p=0;
    for(int i=1;i<n;i++)
    {
        double t=a[i-1];
        while(a[i]-t>x)
        {
            t=t+x;
            p++;
        }
    }
    //cout<<p<<endl;
    if(p>k)
        return true;
    else
        return false;
}
int main()
{
    while(scanf("%d%lf%lf",&n,&m,&k)!=EOF)
    {
        for(int i=0;i<n;i++)
            scanf("%lf",&a[i]);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX