sln_2016_15
Copyright(c) Eric Mertens 2021
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Main

Description

Synopsis

Documentation

main :: IO () Source #

>>> :main
Just 376777
Just 3903937

solve Source #

Arguments

:: [(Integer, Integer, Integer, Integer)]

disc location, disc size, initial time, initial rotations

-> Maybe Integer

time to press button

Given a list of discs, find the right time to push the button.

Example:

Disc #1 has 5 positions; at time=0, it is at position 4.
Disc #2 has 2 positions; at time=0, it is at position 1.
>>> solve [(1, 5, 0, 4), (2, 2, 0, 1)]
Just 5