AOJ 1007 JPEG Compression