defmodule Main do def input, do: IO.read(:line) |> String.trim def ii, do: input() |> String.to_integer def li, do: input() |> String.split |> Enum.map(&String.to_integer/1) def yn(b), do: IO.puts(if b, do: "Yes", else: "No") def main do n = ii() for _ <- 1..n, reduce: {0, 0} do {hit, miss} -> [t, s] = input() |> String.split t = String.to_integer(t) # タイプできる文字数 x = min(div(12 * t, 1000), String.length(s)) {hit + x, miss + String.length(s) - x} end |> then(fn {hit, miss} -> IO.puts "#{hit} #{miss}" end) end end