------art_52348_21312462.1184514137696
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi all.
Attached are my solutions.
Limitations and comments are listed in the code. Pretty basic, nothing fancy.

-- 
 Jesse Brown
 www.cs.drexel.edu/~jrb562
 not_in_units  unit for unit in UNITS if unit not in units]

------art_52348_21312462.1184514137696
Content-Type: text/x-ruby-script; name=naive.rb; charset=ANSI_X3.4-1968
Content-Transfer-Encoding: base64
X-Attachment-Id: f_1k70w00
Content-Disposition: attachment; filename="naive.rb"

IyEvdXNyL2Jpbi9lbnYgcnVieQojCiMgSmVzc2UgQnJvd24KIwojIFRoaXMgc29sdXRpb24gZmFs
bHMgdG8gYSBob3JyaWJsZSBnZW9tZXRyaWMgc2VyaWVzCiMgSXRzIHNpbXBsZSB0byB3cml0ZSBh
bmQgZWZmZXRpdmUgZm9yICh2ZXJ5KSBzbWFsbCBzZXRzLgojIE8oMl5uKQojCiMgTGltaXRhdGlv
bnMgKG90aGVyIHRoYW4gdGhlIHJ1bnRpbWUpOgojIFRoaXMgc2NyaXB0IHdvdWxkIGdldCB5b3Ug
ZmlyZWQsIGRvbnQgdXNlIGl0IDspCiMgVGhlIG92ZXJ1c2Ugb2YgZ2xvYmFsIHZhcmlhYmxlIGNv
dWxkIGhhdmUgYmVlbiAKIyB3b3JrZWQgb3V0IG9mIHRoZSBkZXNpZ24gd2l0aCBsaXR0bGUgZWZm
b3J0LgojCgpBUllfU1ogPSAxMAoKIyBUaGUgcmVjdXJzaXZlIHdvcmtob3JzZQpkZWYgbWF4X3N1
YihzdW0sIGxlZnQsIHJpZ2h0KQogICByZXR1cm4gaWYgbGVmdCA+IHJpZ2h0CiAgICRzdW0sICRs
ZWZ0LCAkcmlnaHQgPSBzdW0sIGxlZnQsIHJpZ2h0IGlmIHN1bSA+ICRzdW0KICAgbWF4X3N1Yihz
dW0gLSAkYXJ5W2xlZnRdLCBsZWZ0ICsgMSwgcmlnaHQpICAgCiAgIG1heF9zdWIoc3VtIC0gJGFy
eVtyaWdodF0sIGxlZnQsIHJpZ2h0IC0gMSkKZW5kCgojIEdlbmVyYXRlIHJhbmRvbSBOLWVsZW1l
bnQgYXJyYXkgcmFuZ2VkICgtTiwgTikKJGFyeSA9ICgtQVJZX1NaLi5BUllfU1opLnRvX2Euc29y
dF9ieSB7cmFuZH1bMC4uQVJZX1NaXSAKCiRsZWZ0ID0gMAokcmlnaHQgPSBBUllfU1oKJHN1bSA9
IGV2YWwgJGFyeS5qb2luKCcrJykgIyBuZWVkZWQgZm9yIGFuIGFsbCBuZWdhdGl2ZSBhcnJheQoK
bWF4X3N1YigoZXZhbCAkYXJ5LmpvaW4oJysnKSksIDAsIEFSWV9TWikKCnB1dHMgIkFycmF5ICAg
ICA6IFsgIiArICRhcnkuam9pbignICwgJykgKyAiIF0iCnB1dHMgIlN1bSAgICAgICA6ICIgKyAk
c3VtLnRvX3MKcHV0cyAiU3ViIEFycmF5IDogWyAiICsgJGFyeVskbGVmdC4uJHJpZ2h0XS5qb2lu
KCcgLCAnKSArICIgXVxuXG4iCiAgIA------art_52348_21312462.1184514137696
Content-Type: text/x-ruby-script; name=matrix.rb; charset=ANSI_X3.4-1968
Content-Transfer-Encoding: base64
X-Attachment-Id: f_1k719qh
Content-Disposition: attachment; filename="matrix.rb"

IyEvdXNyL2Jpbi9lbnYgcnVieQojCiMgSmVzc2UgQnJvd24KIwojIEFnYWluLCBkeW5hbWljIHBy
b2dyYW1pbmcgYWxsb3dzIGZvciBhIGNvbmZvcnRhYmxlIHRpbWUuCiMgVGhlIGVudGlyZSBtYXRy
aXggY2FuIGJlIGNhbHVsYXRlZCBpbiBPKG5eMikuIEJ1dCB3ZSBuZWVkIHRvIAojIGFsbG93IGZv
ciBhbnkgaW5kZXggaW50byB0aGUgbWF0cml4IHRvIGJlIHRoZSBvcmlnaW4uCiMgTyhuXjQpCiMK
IyBMaW1pdGF0aW9uczoKIyBXaGlsZSB0aGlzIGNvdWxkIGVhc2l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CiAgIGVuZAogICAKICAgIyBnaXZlIGJhY2sgdGhlIHZhbHVlIGFuZCB0aGUgYm90dG9tIHJp
Z2h0IGluZGV4CiAgIHJldHVybiBbbWF4LCBfcm93LCBfY29sXQogICAgICAgICAKZW5kCgphID0g
WwogICBbMSwgLTEsIDQsIDFdLAogICBbLTEsIDEsIDEsIC0xXSwKICAgWzEsIDUsIDEsIC0xXSwK
ICAgWy0yLCAtMSwgLTEsIC0yXV0KbWF4ID0gYVswXVswXQpyMSwgcjIsIGMxLCBjMiA9IDAsIDMs
IDAsIDMKcHJpbnRfbWF0cml4KFswLDBdLCBbMywzXSwgYSwgdHJ1ZSkKKDAuLjMpLmVhY2ggZG8g
fHJvd3wKICAgKDAuLjMpLmVhY2ggZG8gfGNvbHwKICAgICAgZGF0YSA9IHN1Yl9tYXRyaXgocm93
LGNvbCxhKQogICAgICBpZiBkYXRhWzBdID49IG1heAogICAgICAgICBtYXggPSBkYXRhWzBdCiAg
ICAgICAgIHIxLCBjMSA9IHJvdywgY29sCiAgICAgICAgIHIyLCBjMiA9IGRhdGFbMV0sIGRhdGFb
Ml0KICAgICAgZW5kCiAgIGVuZAplbmQKcHJpbnRfbWF0cml4KFtyMSxjMV0sIFtyMixjMl0sIGEp
Cg------art_52348_21312462.1184514137696
Content-Type: text/x-ruby-script; name=dynamic.rb; charset=ANSI_X3.4-1968
Content-Transfer-Encoding: base64
X-Attachment-Id: f_1k71feh
Content-Disposition: attachment; filename="dynamic.rb"

IyEvdXNyL2Jpbi9lbnYgcnVieQojCiMgSmVzc2UgQnJvd24KIwojIEJ5IHVzaW5nIGEgZHluYW1p
YyBwcm9ncmFtbWluZyBhcHByb2FjaCB0aGUgcHJldmlvdXMKIyBnZW9tZXRyaWMgc2VyaWVzIGNh
biBiZSByZWR1Y2VkIHRvIGFuIGFyaXRobWV0aWMgc2VyaWVzCiMgTyhuXjIpCiMKIyBMaW1pdGF0
aW9uczoKIyBTaW5jZSB0aGVyZSBpcyBubyBsb29rLW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