class Interval
	def initialize(*args)
		@min, @max = args
	end
	attr_reader :min, :max
end

def merged_length(intervals)
	a = intervals.map{|i| [i.min, i.max]}.sort_by(&:first)
	merged = []
	a.each{|l, r|
		if merged.empty? or merged[-1][1] < l
			merged << [l, r]
		else
			merged[-1][1] = r if r > merged[-1][1]
		end
	}
	merged.map{|l, r| r - l}.inject(:+)
end

loop.with_index {|_, k|
	n = gets.to_i
	break if n == 0

	event_queue = []
	n.times {
		x, y, r = gets.split.map(&:to_f)
		i = Interval.new(y - r, y + r)
		event_queue << [x - r, :add, i]
		event_queue << [x + r, :del, i]
	}
	event_queue.sort_by!(&:first)

	area = 0
	len = 0
	intervals = []
	x = 0
	until event_queue.empty?
		area += len * (event_queue[0][0] - x)
		x = event_queue[0][0]
		while !event_queue.empty? && event_queue[0][0] == x
			_, command, interval = event_queue.shift
			if command == :add
				intervals << interval
			else
				intervals.delete interval
			end
		end
		
		len = merged_length(intervals)
	end

	printf("%d %.2f\n", k+1, area)
}