#!/bin/ruby def profit(b, s, c) b + s - c end t = gets.strip.to_i for a0 in (0..t-1) b, s, c = gets.strip.split(' ') b = b.to_i s = s.to_i c = c.to_i result = profit(b, s, c) puts result end