Scanf.scanf "%d %d %d %d" (fun a b c d -> let calc combo a = let rec loop combo a = if combo >= 100 then loop (combo - 100) (a * 2) else a in loop combo a in if d < 10 then ( let rec loop combo great perfect score = if perfect = 0 then score else if great > 0 then loop (combo + 1) (great - 1) perfect (score + calc combo 50) else loop (combo + 1) great (perfect - 1) (score + calc combo 100) in let sc = loop 0 b a 0 in Printf.printf "Possible\n%d\n" sc ) else print_endline "Impossible" )