Skip to content

Commit

Permalink
Problem 85
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbantuelle committed Oct 5, 2018
1 parent 39be466 commit f13142b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions 085.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
best = 0
area = 0

m = 1
n = 0

result = 0

while result < 2_000_000
while result < 2_000_000
n += 1
result = m * (m+1) * n * (n+1) / 4
if result < 2_000_000 && result > best
best = result
area = m*n
end
end
m += 1
n = 1
result = m * (m+1) * n * (n+1) / 4
if result < 2_000_000 && result > best
best = result
area = m*n
end
break if result > 2_000_000
end

puts area

0 comments on commit f13142b

Please sign in to comment.