float solve(String input) {
def (hours, minutes) = input.split(/:/)*.toInteger()
float minutesPhase = minutes / 60
float hoursPhase = ((hours % 12) / 12) + (minutesPhase / 12)
float phaseDiff
= Math.
abs(hoursPhase
- minutesPhase
) return 360 * (0.5 - Math.
abs(phaseDiff
- 0.5)) }
println solve('15:20')
ZmxvYXQgc29sdmUoU3RyaW5nIGlucHV0KSB7CiAgICBkZWYgKGhvdXJzLCBtaW51dGVzKSA9IGlucHV0LnNwbGl0KC86LykqLnRvSW50ZWdlcigpCiAgICBmbG9hdCBtaW51dGVzUGhhc2UgPSBtaW51dGVzIC8gNjAKICAgIGZsb2F0IGhvdXJzUGhhc2UgPSAoKGhvdXJzICUgMTIpIC8gMTIpICsgKG1pbnV0ZXNQaGFzZSAvIDEyKQogICAgZmxvYXQgcGhhc2VEaWZmID0gTWF0aC5hYnMoaG91cnNQaGFzZSAtIG1pbnV0ZXNQaGFzZSkKICAgIHJldHVybiAzNjAgKiAoMC41IC0gTWF0aC5hYnMocGhhc2VEaWZmIC0gMC41KSkKfQoKcHJpbnRsbiBzb2x2ZSgnMTU6MjAnKQ==