Advertisement
Guest User

Untitled

a guest
Mar 28th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. let rest (r:int, b:int) =
  2. if (r<0 && b>0) then System.Console.WriteLine(r+b)
  3. elif (r<0 && b<0) then System.Console.WriteLine(r-b)
  4. else System.Console.WriteLine(r)
  5. let main() =
  6. seq { for i in 1 .. stdin.ReadLine()|> int do yield stdin.ReadLine() }
  7. |> Seq.iter (fun x -> rest((x.Split(" ").[0]|>int)%(x.Split(" ").[1]|>int), (x.Split(" ").[1]|>int)))
  8. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement