use IO; iter ops() { yield 1; // Initial state for line in stdin.lines().strip() { select line[0..3] { when "noop" do yield 0; when "addx" { yield 0; yield line[5..] : int; } } } } const deltas = ops(), cycles = deltas.size, Xs: [1..cycles] int = + scan deltas, interesting = 20..220 by 40; writeln(+ reduce (Xs[interesting] * interesting)); config const crtRows = 6, crtCols = 40; const Screen = {0..