homework of CS161 by Dawn Song