class Day
attr_accessor :days
def initialize(days)
@days = days
end
def output(arr, offsets, vars)
op = []
last = days[-1]
slast = days[-2]
#peak = arr.index(arr[12..-1].reverse.min)
=begin
peak = days[12...24].index(days[12...24].reverse.max) + 12
peakright = peak
peakleft = peak
while peakright < 22
peakright += 1
peakleft -= 1
end
peakright += 1
peakleft -= 0.8
=end
(1..12).each do |num|
a, b, c, d = vars[num-1]
if arr.include?(num)
op << ((((self.days[-num])*a + last*b + slast*c) / (a+b+c+d) - offsets[num - 1]).round(2))
slast = last
last = op[-1]
op[-1] = op[-1].to_s
else
op << "?"
end
end
puts op.join(" ")
end
end
count = gets.chomp.to_i
days = []
count.times do
days << Day.new(gets.chomp.split(" ").map(&:to_f))
end
choose = [1, 2, 3, 4, 5, 6, 7, 8]
offsets = [-0.05, -0.07, 0.06, 0.1, 0.12, 0.03, 0.06, -0.01, 0.06, 0.08, 0.09, 0.22]
vars = [[33.77051576875078, -4.853476786993251, -2.623631873100695, -0.09849954113404995],
[25.02121681489971, 36.058277516169994, 35.789640924004274, -0.4982704277638004],
[-3.2002591903277975, 8.222976377960668, 36.76395473709071, 0.13785085006072062],
[1.534539262432269, 8.060594693255599, 20.63528044365322, 0.29094068260449685],
[9.082277596649746, 11.600166116220935, 18.693503830464156, 0.4303366407428453],
[15.868865655608323, 17.1598607039435, 15.578971734804599, 1.0561295932090482],
[12.54966615630024, 10.734148906059973, 15.820062832146878, 0.7942871665731337],
[41.83890283027029, -2.672179639765685, 47.04547995374211, 0.1852078676166402],
[8.534550230464724, 2.7206035126055825, 11.238345957329667, 0.2761692971642925],
[3.5918137092155393, 10.824594071674802, 4.3973881912024675, 0.5416647411410879],
[6.112303613870343, 11.46831921634406, 2.2458907155032235, -0.11794423160520287],
[-1.126057590064534, -5.648811001638601, -7.545559279710185, -0.0890578869489166]]
days.each do |day|
day.output(choose, offsets, vars)#, peaktweak)
end