Aerodynamics

Time limit2sMemory limit128 MB

Summary
Given points in 3D, build the convex hull and output the exact rational area of its cross-section polygon for every integer z between two bounds.
Level

Hard8 of 10

Topics
Geometry, Math, Implementation
Solved
No attempts yet

Problem

Bill works in a secret laboratory, where he leads the aerodynamics department and designs missiles.

A striking result in aerodynamics is the Whitcomb area rule. An object flying at high subsonic speeds develops local supersonic airflow, and the resulting shock waves produce wave drag. Wave drag does not depend on the exact shape of the object, but only on its cross-sectional area profile.

Set up a coordinate system whose OZ axis points along the object's direction of motion. Let S(z0)S(z_0) denote the area of the object's cross-section cut by the plane z=z0z = z_0. The function SS that maps z0z_0 to S(z0)S(z_0) is the object's cross-sectional profile. There is an ideal aerodynamic shape, the Sears-Haack body; the closer an object's cross-sectional profile is to that of the Sears-Haack body, the less wave drag it produces. That is the essence of the Whitcomb area rule.

Before a missile is even built, Bill's department studies its aerodynamics with computer simulations. To approximate a missile's cross-sectional profile, one samples S(z0)S(z_0) at every integer z0z_0 from zminz_{min} to zmaxz_{max}.

cross-section figure

Given a description of the missile, compute S(z0)S(z_0) for every integer z0z_0 from zminz_{min} to zmaxz_{max}, inclusive. The missile is the minimal convex solid (the convex hull) that contains all of the given points. It is guaranteed that some four of the points are not coplanar.

Input

The first line contains three integers nn, zminz_{min}, and zmaxz_{max} (4≤n≤1004 \le n \le 100, 0≤zmin≤zmax≤1000 \le z_{min} \le z_{max} \le 100).

Each of the next nn lines contains three integers xx, yy, and zz — the coordinates of one point. Every coordinate has absolute value at most 100100. No two points coincide, and some four points are not coplanar.

Output

For each integer z0z_0 from zminz_{min} to zmaxz_{max}, inclusive, print the cross-sectional area S(z0)S(z_0) on its own line, in increasing order of z0z_0.

Every cross-section is a convex polygon whose vertices are intersections of the solid's edges with the plane z=z0z = z_0, so each vertex has rational coordinates and S(z0)S(z_0) is always a rational number. Print S(z0)S(z_0) as an exact fraction in lowest terms, formatted as p/q, where q≥1q \ge 1 and gcd⁡(p,q)=1\gcd(p, q) = 1. In particular, an area equal to the integer aa is printed as a/1, and a zero area (the plane misses the solid or only touches it along a single point or segment) is printed as 0/1.

Examples5

  1. Example 1

    Input
    9 0 5
    0 0 5
    -3 0 2
    0 -1 2
    3 0 2
    0 1 2
    2 2 0
    2 -2 0
    -2 -2 0
    -2 2 0
    
    Expected output
    16/1
    373/25
    252/25
    112/25
    28/25
    0/1
    
  2. Example 2

    Input
    4 0 3
    0 0 0
    6 0 0
    0 6 0
    0 0 3
    
    Expected output
    18/1
    8/1
    2/1
    0/1
    
  3. Example 3

    Input
    8 0 4
    0 0 0
    2 0 0
    2 3 0
    0 3 0
    0 0 4
    2 0 4
    2 3 4
    0 3 4
    
    Expected output
    6/1
    6/1
    6/1
    6/1
    6/1
    
  4. Example 4

    Input
    5 0 3
    1 1 0
    1 -1 0
    -1 -1 0
    -1 1 0
    0 0 3
    
    Expected output
    4/1
    16/9
    4/9
    0/1
    
  5. Example 5

    Input
    4 1 1
    0 0 0
    6 0 0
    0 6 0
    0 0 3
    
    Expected output
    8/1