All pastes #963030 Raw Edit

Untitled

public text v1 · immutable
#963030 ·published 2008-03-30 05:09 UTC
rendered paste body
#/usr/bin/python
# -*- coding: utf-8 -*-

# 2008 Park "segfault" J. K., No Right Reserved.

import sys

def readfile(filename):
    lines = open(filename, 'r').read().strip().splitlines()
    pnt = 1
    tl = []

    for x in xrange(0, int(lines[0])):
        xc = int(lines[pnt])
        tl.append(unpack(lines[pnt+1:pnt+1+xc]))
        pnt += xc+1

    return tl

def unpack(lines):
    l = []
    for x in map(lambda i: map(lambda j: int(j), i.split()), lines):
        l.append(tuple(x))

    return l


slist = readfile(sys.argv[1])

for x in slist:
    xc = map(lambda i: i[0], x)
    yc = map(lambda i: i[1], x)

    print abs(max(xc) - min(xc)) * abs(max(yc) - min(yc))