The forbidden sanctuaryEnter the trial
A trial of inference & algorithms

The
Ninth Gate.

Eight rivers carry the dead. One law decides who crosses. Recover the law from the tablets, follow Ariadne’s thread, and break the seal of Hades.

Descend into the labyrinth

I. The broken tablets

These are the last records of those who entered Medusa’s temple. Each tablet pairs an offering with the number the oracle returned.

“The stone remembers their order.
The coils return, but never rest.
Some footsteps fade before the next is heard.”

All tablets obey the same law. Counts are recorded modulo 1000000007.

II. The eight rivers

Download the final input: the first line is T. Each case has a line containing N and W, followed by N integer heights. There are 348,000 stones in total; heights may repeat or be negative. Produce one decimal answer per case, in order.

The oracle has fallen silent.

III. Ariadne’s thread

“The mirror answers only to what the stone remembers.”

Inspect the sealed relic

Eight offerings, in order. Separate them with whitespace or colons.