QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#277881#2483. Roof EscapeSadimkAC ✓2ms4224kbC++144.3kb2023-12-07 07:04:512023-12-07 07:04:52

Judging History

你现在查看的是最新测评结果

  • [2023-12-07 07:04:52]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:4224kb
  • [2023-12-07 07:04:51]
  • 提交

answer

#include <bits/extc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
#define vt vector
#define pii pair<int, int>
#define pb push_back
#define umap unordered_map
#define uset unordered_set
#define all(x) begin(x), end(x)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define contains(l, a) l.find(a) != l.end()
#define DEBUG 1
#define dbg(x) \
    if (DEBUG) { cout << #x << " = " << x << endl; }
#define dbgv(x) \
    if (DEBUG) { \
        cout << #x << " = "; \
        for (auto _i : x) cout << _i << " "; \
        cout << endl; \
    }
#define dbgm(x, n, m) \
    if (DEBUG) { \
        cout << #x << " = " << endl; \
        FOR(_i, 0, n) { \
            FOR(_j, 0, m) cout << x[_i][_j] << " "; \
            cout << endl; \
        } \
    }

typedef int T;
struct pt {
    T x, y;
    pt(T x = 0, T y = 0) : x(x), y(y) {}
};

bool segInt(pt p1, pt p2, pt p3, pt p4) {
  int d1 = (p4.y - p3.y) * (p1.x - p3.x) + (p3.x - p4.x) * (p1.y - p3.y);
  int d2 = (p4.y - p3.y) * (p2.x - p3.x) + (p3.x - p4.x) * (p2.y - p3.y);
  int d3 = (p2.y - p1.y) * (p3.x - p1.x) + (p1.x - p2.x) * (p3.y - p1.y);
  int d4 = (p2.y - p1.y) * (p4.x - p1.x) + (p1.x - p2.x) * (p4.y - p1.y);
  return ((d1 > 0 && d2 < 0) || (d1 < 0 && d2 > 0)) &&
  ((d3 > 0 && d4 < 0) || (d3 < 0 && d4 > 0));
}

int main() {
  cout.precision(10);
  int W, H, Sx, Sy, Ex, Ey; cin >> W >> H >> Sx >> Sy >> Ex >> Ey;

  ld hor = sqrtl((Sx - Ex)*(Sx - Ex) + (Sy - Ey)*(Sy - Ey));

  H /= 2;
  W /= 2;

  vt<vi> grid(H, vi(W));
  FOR(i, 0, H) FOR (j, 0, W) cin >> grid[i][j];

  int Dx = abs(Ex-Sx);
  int Dy = abs(Ey-Sy);

  pt s(Sx, Sy), e(Ex, Ey);

  int vert = 0;
  int current_height = grid[Sy/2][Sx/2];

  int grid_x = Sx/2;
  int grid_y = Sy/2;
  int grid_dx = (Ex > Sx) - (Sx > Ex);
  int grid_dy = (Ey > Sy) - (Sy > Ey);


  if (Dx > Dy) {
    int dx = (Ex > Sx) - (Sx > Ex);
    int dy = 2*((Ey > Sy) - (Sy > Ey));
    int y = Sy-dy/2;
    for (int x = Sx; x != Ex; x+=dx) {
      if (x%2) continue;
      bool int1 = segInt(s, e, pt(x, y), pt(x, y+dy));
      bool int2 = segInt(s, e, pt(x, y+dy), pt(x, y+2*dy));

      int h1 = grid[grid_y][grid_x+grid_dx];
      int h2 = grid[grid_y+grid_dy][grid_x+grid_dx];
      int h3 = grid[grid_y+grid_dy][grid_x];

      if (!int1 && !int2) {
        // first move up (to Q)
        vi temp = {h1, h2, h3};
        sort(all(temp));
        if (temp[1] > current_height) {
          vert += abs(current_height - temp[1]);
          current_height = temp[1];
        }

        // Now move down
        vert += abs(current_height - h2);
        current_height = h2;

        y += dy;
        grid_y += grid_dy;
      } else if (int1) {
        vert += abs(current_height - h1);
        current_height = h1;
      } else {
        vert += abs(current_height - h3);
        current_height = h3;
        vert += abs(current_height - h2);
        current_height = h2;
        y += dy;
        grid_y += grid_dy;
      }
      grid_x += grid_dx;
    }
  } else {
    int dy = (Ey > Sy) - (Sy > Ey);
    int dx = 2*((Ex > Sx) - (Sx > Ex));
    int x = Sx-dx/2;
    for (int y = Sy; y != Ey; y+=dy) {
      if (y%2) continue;
      bool int1 = segInt(s, e, pt(x, y), pt(x+dx, y));
      bool int2 = segInt(s, e, pt(x+dx, y), pt(x+2*dx, y));
      int h1 = grid[grid_y+grid_dy][grid_x];
      int h2 = grid[grid_y+grid_dy][grid_x+grid_dx];
      int h3 = grid[grid_y][grid_x+grid_dx];

      // dbg(grid_x);
      // dbg(grid_y);

      // cout << x << " " << y << " " << x+dx << " " << y << ": " << int1 << endl;

      // cout << x+dx << " " << y << " " << x+2*dx << " " << y << ": " << int2 << endl;

      if (!int1 && !int2) {
        // first move up (to Q)
        vi temp = {h1, h2, h3};
        sort(all(temp));
        if (temp[1] > current_height) {
          vert += abs(current_height - temp[1]);
          current_height = temp[1];
        }

        // Now move down
        vert += abs(current_height - h2);
        current_height = h2;

        x += dx;
        grid_x += grid_dx;
      } else if (int1) {
        vert += abs(current_height - h1);
        current_height = h1;
      } else {
        vert += abs(current_height - h3);
        current_height = h3;
        vert += abs(current_height - h2);
        current_height = h2;
        x += dx;
        grid_x += grid_dx;
      }
      grid_y += grid_dy;
    }
  }
  cout << hor + vert << endl;



}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3772kb

input:

4 26 1 1 3 25
0 1
0 5
5 5
0 1
2 1
4 1
5 0
0 0
1 0
6 4
3 2
5 4
1 5

output:

53.08318916

result:

ok found '53.08319', expected '53.08319', error '0.00000'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3784kb

input:

8 8 1 7 7 1
2 3 2 0
2 1 1 2
1 2 0 0
0 0 0 1

output:

14.48528137

result:

ok found '14.48528', expected '14.48528', error '0.00000'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3800kb

input:

2 2 1 1 1 1
100

output:

0

result:

ok found '0.00000', expected '0.00000', error '-0.00000'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3740kb

input:

4 4 1 1 3 3
100 1
1 100

output:

2.828427125

result:

ok found '2.82843', expected '2.82843', error '0.00000'

Test #5:

score: 0
Accepted
time: 0ms
memory: 4024kb

input:

4 4 1 1 3 3
1 100
100 1

output:

200.8284271

result:

ok found '200.82843', expected '200.82843', error '0.00000'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3800kb

input:

4 4 1 3 3 1
1 100
100 1

output:

2.828427125

result:

ok found '2.82843', expected '2.82843', error '0.00000'

Test #7:

score: 0
Accepted
time: 0ms
memory: 4036kb

input:

2 56 1 23 1 17
1
0
1
0
1
0
0
4
1
3
1
1
3
0
3
1
1
0
0
2
0
2
1
0
1
0
0
0

output:

10

result:

ok found '10.00000', expected '10.00000', error '0.00000'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3960kb

input:

2 28 1 9 1 23
2
1
1
3
2
1
2
0
3
1
1
1
1
3

output:

23

result:

ok found '23.00000', expected '23.00000', error '0.00000'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3740kb

input:

2 18 1 11 1 13
1
0
2
0
4
0
2
2
4

output:

4

result:

ok found '4.00000', expected '4.00000', error '0.00000'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3808kb

input:

2 400 1 133 1 399
3
6
2
3
0
2
0
3
6
1
6
3
1
5
3
1
6
3
0
2
4
3
3
2
3
0
6
4
2
5
0
3
1
1
3
0
1
3
0
3
5
2
1
2
4
5
0
2
1
0
4
7
3
1
6
4
3
5
2
0
0
3
2
0
2
7
1
0
2
1
2
0
3
0
3
0
6
2
0
4
2
0
3
3
5
0
3
6
3
0
3
2
1
5
1
1
2
6
1
2
1
0
1
2
1
3
2
4
0
5
1
4
2
2
4
4
3
2
1
5
2
3
1
0
0
2
7
5
0
0
2
1
1
0
4
4
2
0
1
4
5
...

output:

560

result:

ok found '560.00000', expected '560.00000', error '0.00000'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3864kb

input:

2 200 1 117 1 97
1
7
2
2
0
4
3
0
0
0
0
5
4
0
4
4
7
0
2
7
3
5
0
1
2
4
2
0
0
0
3
3
1
3
2
2
2
0
3
3
3
0
0
3
1
3
4
2
1
6
0
1
0
2
1
3
5
2
5
2
0
1
0
1
0
1
1
3
3
3
1
5
1
1
7
0
2
2
2
7
2
1
4
3
1
1
0
0
1
2
1
0
6
2
2
2
1
1
1
0

output:

46

result:

ok found '46.00000', expected '46.00000', error '0.00000'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3748kb

input:

2 132 1 41 1 65
3
0
3
3
2
2
5
2
0
2
3
3
2
1
2
4
0
4
5
1
2
1
0
2
2
1
0
6
1
1
5
2
1
0
2
4
2
5
1
6
0
3
1
1
5
1
2
7
2
2
2
1
5
6
0
5
4
0
5
2
1
1
1
4
0
0

output:

49

result:

ok found '49.00000', expected '49.00000', error '0.00000'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3736kb

input:

4 100 3 37 3 53
2 0
1 3
0 4
2 0
0 2
0 1
0 4
4 0
5 5
3 6
1 4
1 1
6 0
1 3
3 5
5 4
3 0
2 0
2 3
0 1
0 3
4 4
5 3
3 0
0 2
4 1
0 3
0 5
1 2
1 4
1 0
2 0
2 0
0 0
0 2
4 1
4 0
1 5
4 0
0 2
1 7
6 2
1 4
0 0
0 6
5 5
2 0
0 3
3 1
2 4

output:

30

result:

ok found '30.00000', expected '30.00000', error '0.00000'

Test #14:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

4 80 1 67 3 57
1 4
0 5
1 3
1 6
0 0
5 0
0 1
1 0
0 6
3 0
4 0
1 0
1 2
1 2
0 0
6 2
2 2
1 3
0 3
3 2
2 2
0 3
1 2
0 2
0 0
6 6
1 4
1 4
0 4
1 7
1 3
6 1
3 3
5 5
1 1
4 3
1 4
3 5
5 1
2 1

output:

25.19803903

result:

ok found '25.19804', expected '25.19804', error '0.00000'

Test #15:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

6 66 1 59 1 51
2 1 1
5 2 6
2 3 2
0 2 6
2 3 2
0 4 2
4 1 5
2 0 6
4 2 2
0 0 1
1 2 0
3 4 2
0 2 1
1 1 2
4 0 3
0 1 0
2 6 5
1 0 5
0 2 1
1 3 3
2 5 3
3 1 4
1 7 1
3 2 5
2 0 5
3 4 5
4 3 0
5 2 4
0 6 3
2 4 4
1 2 0
0 6 0
4 4 3

output:

17

result:

ok found '17.00000', expected '17.00000', error '0.00000'

Test #16:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

6 56 1 19 5 19
1 5 5
1 1 4
4 2 4
0 0 2
0 1 4
4 2 3
3 1 5
4 4 2
4 4 3
3 0 2
0 1 1
7 2 5
0 3 1
4 1 2
6 0 5
3 1 2
0 6 3
5 2 1
1 2 4
0 1 0
0 0 3
5 1 2
5 2 0
4 5 1
6 5 2
3 2 4
5 6 4
5 7 0

output:

9

result:

ok found '9.00000', expected '9.00000', error '0.00000'

Test #17:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

8 50 1 31 3 7
4 3 3 1
1 3 0 1
6 0 1 4
0 0 1 5
1 3 0 3
0 4 0 0
3 3 3 5
2 3 2 1
0 5 1 4
1 5 3 7
1 2 4 3
6 0 3 1
2 5 6 0
4 5 4 2
2 1 1 7
6 2 4 3
2 3 3 0
0 0 2 3
2 0 4 1
0 1 3 3
2 0 2 5
2 6 1 0
3 1 2 1
5 2 4 1
0 2 4 2

output:

52.08318916

result:

ok found '52.08319', expected '52.08319', error '0.00000'

Test #18:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

8 44 3 13 7 17
1 4 1 5
2 1 0 4
1 0 5 2
0 0 4 0
1 0 4 2
5 2 2 0
0 1 1 1
1 0 2 4
1 0 3 3
4 0 1 0
0 2 2 4
4 1 1 0
4 7 2 2
4 4 4 5
0 2 0 2
4 2 6 2
4 1 3 0
4 6 2 4
7 3 2 0
6 4 1 0
1 2 5 1
2 2 3 0

output:

7.656854249

result:

ok found '7.65685', expected '7.65685', error '0.00000'

Test #19:

score: 0
Accepted
time: 1ms
memory: 3972kb

input:

100 100 21 15 63 83
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

79.92496481

result:

ok found '79.92496', expected '79.92496', error '0.00000'

Test #20:

score: 0
Accepted
time: 2ms
memory: 4016kb

input:

300 300 199 221 255 3
0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 0 1 1 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 ...

output:

271.0777643

result:

ok found '271.07776', expected '271.07776', error '0.00000'

Test #21:

score: 0
Accepted
time: 1ms
memory: 3828kb

input:

20 500 5 53 1 359
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 ...

output:

306.0261427

result:

ok found '306.02614', expected '306.02614', error '0.00000'

Test #22:

score: 0
Accepted
time: 1ms
memory: 3848kb

input:

20 500 19 427 1 31
0 0 0 0 0 0 1 1 0 0
1 0 1 1 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0
0 0 0 1 0 0 0 0 0 1
1 0 1 0 0 1 1 0 1 0
0 0 1 0 0 0 0 1 0 1
0 1 0 0 0 0 1 1 0 0
0 0 1 1 0 1 1 0 0 0
1 1 0 1 0 1 1 0 0 0
0 0 0 0 0 0 0 0 0 0
1 1 0 0 1 1 0 1 0 0
1 0 0 0 0 1 0 0 1 1
0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 0 0 1
0...

output:

485.4088798

result:

ok found '485.40888', expected '485.40888', error '0.00000'

Test #23:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

500 20 367 15 323 7
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

44.72135955

result:

ok found '44.72136', expected '44.72136', error '0.00000'

Test #24:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

500 20 153 13 153 5
1 0 1 0 1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 1 0 1 1 1 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 1 1 0 1 0 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 1 ...

output:

11

result:

ok found '11.00000', expected '11.00000', error '0.00000'

Test #25:

score: 0
Accepted
time: 1ms
memory: 3848kb

input:

8 2000 3 269 3 341
0 0 0 1
0 0 0 0
0 1 0 1
0 1 0 0
0 0 0 0
1 0 1 0
0 0 0 0
0 0 1 1
0 0 0 0
0 1 1 0
0 0 1 0
0 0 0 0
0 0 1 0
1 1 0 1
0 0 0 1
0 0 1 0
0 0 1 0
0 1 0 0
1 0 1 0
0 1 1 0
0 0 0 0
0 0 0 0
0 0 0 1
0 1 0 0
1 0 0 0
0 0 1 0
0 1 0 0
0 0 1 0
1 1 0 0
0 1 0 0
1 1 0 0
1 0 1 0
0 0 0 0
0 1 0 0
0 0 0 0
0...

output:

89

result:

ok found '89.00000', expected '89.00000', error '0.00000'

Test #26:

score: 0
Accepted
time: 1ms
memory: 3816kb

input:

2000 8 1257 5 1213 3
0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 1 1 0 1 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0...

output:

57.04543109

result:

ok found '57.04543', expected '57.04543', error '0.00000'

Test #27:

score: 0
Accepted
time: 1ms
memory: 4224kb

input:

2 12000 1 11617 1 9173
116
53
123
391
240
480
746
343
689
568
312
254
30
153
642
12
269
518
172
283
460
763
193
341
92
511
22
144
6
469
487
41
380
172
24
453
520
124
734
134
291
551
519
210
127
29
533
123
101
90
245
192
633
435
343
413
710
230
574
184
53
210
121
924
75
663
221
366
836
123
609
495
65...

output:

343138

result:

ok found '343138.00000', expected '343138.00000', error '0.00000'

Test #28:

score: 0
Accepted
time: 2ms
memory: 3976kb

input:

6 6000 5 3061 3 3761
65 23 136
112 364 257
662 118 428
60 506 687
437 45 99
195 17 61
65 107 65
147 304 957
670 368 277
153 162 471
128 22 348
181 426 113
199 223 63
10 231 507
120 2 685
411 118 919
26 61 347
446 174 193
400 349 173
64 384 235
12 558 206
256 241 124
195 179 71
13 250 211
134 595 210...

output:

95384.00286

result:

ok found '95384.00286', expected '95384.00286', error '0.00000'

Test #29:

score: 0
Accepted
time: 2ms
memory: 4072kb

input:

10 4000 1 3925 5 979
0 218 7 52 96
730 484 600 592 32
53 694 81 275 458
56 124 377 217 0
750 729 17 56 372
71 170 96 280 38
87 471 475 407 594
629 595 385 670 387
589 459 433 128 319
237 386 585 237 32
672 49 387 327 871
431 384 101 513 463
24 219 985 536 363
651 135 163 11 129
744 493 614 739 733
7...

output:

384131.0027

result:

ok found '384131.00270', expected '384131.00272', error '0.00000'

Test #30:

score: 0
Accepted
time: 2ms
memory: 4100kb

input:

12 3000 9 775 9 2565
516 518 43 588 225 279
483 581 148 597 576 164
475 439 245 44 513 335
505 292 396 109 121 162
50 63 123 195 329 129
467 659 728 493 663 309
291 444 30 384 27 446
360 401 267 496 411 801
158 60 278 328 455 115
54 735 324 649 11 81
383 59 211 28 112 522
914 802 152 374 119 30
70 7...

output:

239411

result:

ok found '239411.00000', expected '239411.00000', error '0.00000'

Test #31:

score: 0
Accepted
time: 0ms
memory: 3940kb

input:

16 2400 15 817 13 1343
52 588 698 118 141 30 561 198
597 445 180 791 72 65 121 64
133 79 453 206 397 468 706 868
528 36 505 289 830 95 168 479
152 428 213 113 129 133 757 66
655 409 195 663 89 135 916 257
211 192 713 791 149 311 407 427
86 746 93 66 426 653 336 631
766 705 280 29 246 236 184 113
11 ...

output:

75880.0038

result:

ok found '75880.00380', expected '75880.00380', error '0.00000'

Test #32:

score: 0
Accepted
time: 2ms
memory: 3812kb

input:

20 2000 5 75 9 299
254 187 385 415 5 725 163 98 108 258
833 79 605 693 184 34 731 296 330 265
777 123 14 391 82 871 228 142 443 315
95 559 338 101 262 319 58 529 97 44
277 104 120 289 542 284 56 864 176 158
248 398 36 269 520 76 312 179 63 434
577 192 740 323 918 20 88 503 413 186
826 815 121 164 22...

output:

30054.03571

result:

ok found '30054.03571', expected '30054.03571', error '0.00000'

Test #33:

score: 0
Accepted
time: 2ms
memory: 4108kb

input:

22 1714 13 505 3 811
291 303 418 410 452 314 468 187 305 20 91
192 355 398 960 231 453 327 521 365 267 245
204 614 508 130 231 352 714 269 12 127 341
168 480 119 270 263 378 265 240 151 224 2
633 663 166 186 692 704 344 349 804 118 115
407 417 407 664 56 450 97 81 108 622 380
319 35 736 276 540 254 ...

output:

44752.16336

result:

ok found '44752.16336', expected '44752.16336', error '0.00000'

Test #34:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

26 1500 25 625 5 83
423 130 183 646 327 124 135 316 45 122 245 515 348
22 214 557 77 519 190 92 420 110 520 726 40 163
177 313 528 389 107 604 151 104 278 277 506 11 207
488 812 727 192 821 72 582 424 156 649 466 512 208
625 85 325 53 5 164 273 55 169 742 311 194 194
239 688 382 602 504 385 310 19 3...

output:

68202.36888

result:

ok found '68202.36888', expected '68202.36888', error '0.00000'

Test #35:

score: 0
Accepted
time: 1ms
memory: 4080kb

input:

28 1332 15 707 1 681
595 199 48 209 25 61 272 289 328 259 305 343 160 446
601 422 58 605 39 421 49 200 126 775 415 276 871 161
66 708 46 194 162 514 52 350 80 19 451 179 803 279
302 190 906 412 183 640 327 17 159 73 735 103 283 477
303 381 117 53 72 399 207 831 169 5 221 440 493 275
112 443 544 189 ...

output:

3913.529646

result:

ok found '3913.52965', expected '3913.52965', error '0.00000'

Test #36:

score: 0
Accepted
time: 1ms
memory: 3852kb

input:

32 1200 25 373 7 475
281 506 575 152 826 270 34 537 244 17 247 195 222 791 226 55
539 268 152 435 664 295 248 397 340 254 277 224 411 121 214 408
94 436 256 333 305 436 415 130 220 658 207 133 613 56 89 625
580 103 518 469 106 364 492 199 394 634 139 887 423 621 187 14
173 484 67 58 505 477 103 560 ...

output:

15382.57606

result:

ok found '15382.57606', expected '15382.57606', error '0.00000'

Test #37:

score: 0
Accepted
time: 2ms
memory: 3792kb

input:

36 1090 9 1007 3 191
75 75 218 196 85 259 133 280 46 116 142 784 154 79 130 16 537 1
396 103 709 258 680 440 227 27 128 855 278 273 249 181 502 321 325 15
367 244 165 264 82 383 451 121 7 287 724 412 124 136 285 740 793 283
807 218 267 27 558 188 385 384 256 754 779 337 491 780 133 548 213 303
51 58...

output:

120158.0221

result:

ok found '120158.02210', expected '120158.02206', error '0.00000'

Test #38:

score: 0
Accepted
time: 2ms
memory: 3888kb

input:

40 1000 31 29 27 399
171 383 438 395 741 93 210 754 355 218 97 781 362 650 183 814 24 570 124 264
20 158 496 67 506 226 352 961 139 196 35 98 212 51 169 171 416 56 214 406
427 417 463 787 415 585 148 552 356 244 266 168 142 387 88 397 124 257 221 37
304 389 107 398 20 607 71 34 308 203 687 21 61 79 ...

output:

50426.02162

result:

ok found '50426.02162', expected '50426.02162', error '0.00000'

Test #39:

score: 0
Accepted
time: 2ms
memory: 3852kb

input:

42 922 5 769 35 321
783 373 174 32 69 156 6 814 160 536 425 342 35 130 452 411 862 281 473 174 8
327 685 444 308 353 329 111 9 18 575 220 388 627 65 118 363 608 454 358 139 408
945 642 126 263 207 12 246 894 438 28 225 726 24 468 226 498 54 489 200 723 79
277 155 243 222 106 477 216 287 452 161 101 ...

output:

61496.00334

result:

ok found '61496.00334', expected '61496.00334', error '0.00000'

Test #40:

score: 0
Accepted
time: 2ms
memory: 3912kb

input:

46 856 15 669 41 803
750 673 301 324 220 386 801 184 206 34 417 177 448 269 518 363 169 819 434 180 305 222 629
1 597 153 645 388 589 265 569 143 472 711 133 611 98 502 96 302 685 423 742 162 102 43
264 279 772 533 190 50 339 35 176 478 73 283 417 659 462 56 349 740 820 517 331 386 329
287 67 600 53...

output:

21388.49908

result:

ok found '21388.49908', expected '21388.49908', error '0.00000'

Test #41:

score: 0
Accepted
time: 2ms
memory: 3912kb

input:

50 798 49 777 15 501
239 109 21 156 82 293 5 310 332 16 18 57 81 334 670 438 102 260 745 399 190 464 272 504 52
827 616 184 354 192 144 429 102 355 45 313 173 196 260 355 125 86 815 107 445 212 24 372 32 166
202 136 188 65 269 435 589 16 297 254 58 548 556 131 27 363 15 618 468 66 497 366 473 500 59...

output:

41899.08632

result:

ok found '41899.08632', expected '41899.08632', error '0.00000'

Test #42:

score: 0
Accepted
time: 1ms
memory: 3840kb

input:

52 748 39 235 21 693
23 426 809 102 536 545 347 47 234 545 490 29 85 565 31 474 599 549 275 322 343 0 144 517 466 75
846 46 11 258 121 72 517 65 139 34 6 64 667 368 182 752 505 714 647 562 28 81 328 150 341 960
276 32 214 293 375 432 830 57 113 258 370 2 321 617 518 414 284 717 536 510 142 331 42 67...

output:

64827.35358

result:

ok found '64827.35358', expected '64827.35358', error '0.00000'

Test #43:

score: 0
Accepted
time: 2ms
memory: 3884kb

input:

56 704 51 175 33 157
381 818 152 717 220 40 172 98 108 28 769 107 63 142 85 35 69 515 811 131 632 230 104 371 74 209 306 390
419 182 205 304 109 69 121 258 132 773 638 670 267 35 514 547 216 394 116 310 184 483 33 824 1 209 340 459
632 544 49 539 215 413 570 263 899 10 746 374 146 264 159 776 54 401...

output:

4338.455844

result:

ok found '4338.45584', expected '4338.45584', error '0.00000'

Test #44:

score: 0
Accepted
time: 2ms
memory: 3980kb

input:

60 666 59 605 47 401
6 623 504 122 45 227 306 322 193 800 658 421 34 100 348 65 649 564 82 518 165 236 812 364 512 437 333 19 270 155
181 378 477 685 231 249 248 79 607 540 21 428 14 359 302 445 432 108 402 532 277 111 312 109 266 266 41 568 803 24
772 80 278 63 783 225 654 167 68 301 435 627 380 3 ...

output:

29974.35264

result:

ok found '29974.35264', expected '29974.35264', error '0.00000'

Test #45:

score: 0
Accepted
time: 2ms
memory: 3980kb

input:

62 630 23 91 37 499
283 137 501 50 520 732 496 840 412 651 526 70 723 474 315 632 575 790 101 116 288 758 53 730 107 462 213 668 477 266 53
650 111 166 11 718 34 79 325 141 359 71 869 488 128 835 336 221 168 368 316 596 118 879 449 288 221 88 159 239 473 550
267 482 96 187 145 83 228 698 375 76 388 ...

output:

53852.24013

result:

ok found '53852.24013', expected '53852.24013', error '0.00000'

Test #46:

score: 0
Accepted
time: 0ms
memory: 3848kb

input:

66 598 63 331 53 117
406 354 311 207 209 466 455 250 336 437 15 310 48 185 161 583 89 128 450 241 332 52 855 188 204 229 346 415 481 28 32 153 119
73 296 40 198 108 517 414 63 89 590 315 33 371 516 199 18 219 131 185 12 0 763 509 663 296 371 247 42 159 69 4 124 861
412 353 266 344 407 309 318 283 21...

output:

29701.23352

result:

ok found '29701.23352', expected '29701.23352', error '0.00000'

Test #47:

score: 0
Accepted
time: 2ms
memory: 3868kb

input:

70 570 1 185 15 143
18 637 185 394 22 332 193 586 120 192 803 87 278 3 566 830 387 77 304 237 578 431 603 37 271 157 127 585 331 92 51 689 149 334 136
450 42 213 4 195 142 232 543 300 570 120 537 556 583 72 913 695 553 343 395 642 10 802 109 95 105 216 471 557 22 912 204 538 43 78
597 735 548 392 32...

output:

6795.271887

result:

ok found '6795.27189', expected '6795.27189', error '0.00000'

Test #48:

score: 0
Accepted
time: 2ms
memory: 3784kb

input:

72 544 11 407 51 499
406 252 135 281 453 373 302 182 94 84 23 592 11 234 414 536 462 386 253 257 616 17 41 854 231 531 1 200 531 111 334 785 203 299 552 191
946 87 163 38 182 457 243 369 139 81 384 33 590 577 652 204 205 489 788 235 345 338 133 202 415 817 58 178 700 257 256 120 53 217 473 325
469 7...

output:

17508.31949

result:

ok found '17508.31949', expected '17508.31949', error '0.00000'

Test #49:

score: 0
Accepted
time: 2ms
memory: 4080kb

input:

76 520 65 135 25 297
69 628 167 326 222 627 19 317 621 650 846 660 324 274 758 561 339 625 340 890 126 476 387 187 544 821 9 442 76 426 143 498 215 292 45 582 864 82
79 220 123 36 263 214 328 356 125 139 251 114 493 391 44 272 38 344 231 76 316 127 267 262 75 88 734 114 204 67 266 17 182 330 64 30 1...

output:

24069.86522

result:

ok found '24069.86522', expected '24069.86522', error '0.00000'

Test #50:

score: 0
Accepted
time: 2ms
memory: 3904kb

input:

80 500 5 489 1 195
41 106 14 147 120 83 797 32 275 74 191 455 43 16 158 157 185 480 840 684 315 161 783 51 487 423 501 146 558 502 493 470 503 184 254 139 466 680 523 558
271 383 91 260 244 350 333 264 152 284 32 389 427 584 480 168 589 445 275 183 44 15 523 706 109 966 256 54 522 172 643 168 623 27...

output:

45381.02721

result:

ok found '45381.02721', expected '45381.02721', error '0.00000'

Test #51:

score: 0
Accepted
time: 2ms
memory: 3836kb

input:

82 480 7 275 29 469
13 325 256 435 294 34 195 60 325 56 224 556 280 668 437 434 201 240 75 86 833 68 141 777 168 674 16 606 4 174 160 337 189 239 197 580 155 60 71 834 296
648 67 337 334 2 802 475 899 128 58 258 486 144 939 615 635 265 492 457 157 227 249 306 283 189 212 189 522 404 26 364 147 458 7...

output:

30925.24344

result:

ok found '30925.24344', expected '30925.24344', error '0.00000'

Test #52:

score: 0
Accepted
time: 0ms
memory: 3848kb

input:

86 460 37 227 47 261
276 94 254 404 499 100 39 701 106 763 359 102 636 188 398 118 171 291 119 87 83 260 586 584 399 289 118 513 77 370 770 583 88 367 45 97 4 809 55 419 375 678 151
287 127 487 372 40 212 720 239 161 66 23 431 290 251 305 574 156 94 9 628 41 842 877 440 479 56 101 13 121 42 973 128 ...

output:

5707.44009

result:

ok found '5707.44009', expected '5707.44009', error '0.00000'

Test #53:

score: 0
Accepted
time: 2ms
memory: 3840kb

input:

88 444 71 277 31 277
182 715 61 704 161 647 308 373 139 386 70 759 117 30 94 777 256 18 910 641 56 284 138 211 532 111 285 384 98 534 81 162 264 474 488 337 125 589 232 169 210 397 655 431
283 645 265 692 515 500 15 200 9 117 99 15 140 453 718 350 660 324 277 228 390 35 255 312 628 166 570 362 469 7...

output:

3683

result:

ok found '3683.00000', expected '3683.00000', error '0.00000'

Test #54:

score: 0
Accepted
time: 1ms
memory: 3836kb

input:

92 428 55 57 67 425
91 34 216 88 89 157 493 558 306 529 199 140 632 1 222 234 224 483 152 432 15 129 496 52 471 198 294 59 444 199 133 716 507 201 19 771 105 122 816 462 759 129 307 246 561 45
646 184 159 224 612 495 113 707 741 557 8 445 581 197 669 114 762 437 190 746 312 54 945 73 66 287 408 35 7...

output:

52859.1956

result:

ok found '52859.19560', expected '52859.19560', error '0.00000'

Test #55:

score: 0
Accepted
time: 2ms
memory: 4080kb

input:

96 412 47 385 9 221
228 319 546 358 736 658 809 736 88 110 563 534 50 629 533 271 254 388 119 607 191 3 440 483 59 232 200 628 456 425 811 638 99 556 1 273 3 10 516 124 354 23 109 248 334 49 868 589
145 419 352 95 94 398 242 231 469 293 288 306 167 622 768 160 64 263 684 29 774 634 253 594 282 628 6...

output:

26283.34488

result:

ok found '26283.34488', expected '26283.34488', error '0.00000'

Test #56:

score: 0
Accepted
time: 2ms
memory: 3844kb

input:

98 400 43 211 49 107
396 243 123 6 458 747 170 5 794 44 694 403 541 347 676 18 524 98 740 38 723 399 43 91 188 772 45 470 730 347 1 43 664 121 429 221 266 37 6 110 356 439 50 337 300 112 117 488 716
119 465 429 224 27 107 139 49 29 477 624 523 118 102 488 1 408 301 107 93 530 145 492 179 306 829 175...

output:

15448.17293

result:

ok found '15448.17293', expected '15448.17293', error '0.00000'