Count the Overlap by oerjan

p(_:x:_:y:_:w:_:h:r)=[[-x,x+w],[-y,y+h]]:p r
q(a:b:c:_)=a!b#"ab "++a!c#" ac "++b!c#" bc "++a!b!c#" abc ";[x,y]#s=s++show(l x*l y)
(!)=o$o min
l=max 0.sum
o=zipWith
m@main=getLine>>=putStrLn.q.p.map read.words>>m

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page