Skip to content

Instantly share code, notes, and snippets.

@hackugyo
Created February 7, 2013 05:09
Show Gist options
  • Save hackugyo/4728714 to your computer and use it in GitHub Desktop.
Save hackugyo/4728714 to your computer and use it in GitHub Desktop.
max_y = 0
max_z = 0
for a in 0..252 do
for b in 0..252 do
x = (((95*2 + 31 + a / 4.0) * 0.5) + 60).truncate
y = (((80*2 + 31 + b / 4.0) * 0.5 + 5)).truncate
next if (506 - a - b > 252)
for c in 0..(506-a-b) do
z = (((80 * 2 + 31 + c / 4.0) * 0.5 + 5)*1.1).truncate
if (x * y > 23500 and x * z > 25650) then
puts("#{a}(#{x}), #{b}(#{y}), #{c}(#{z}) : x*y = #{x*y}, x*z = #{x*z}")
max_y = x * y if (max_y < x * y)
max_z = x * z if (max_z < x * z)
end
end
end
end
puts ("max_y = #{max_y}, max_z=#{max_z}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment