You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
8.3 KiB

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from codecs import open
"""
CS 188 Local Submission Autograder
Written by the CS 188 Staff
==============================================================================
_____ _ _
/ ____| | | |
| (___ | |_ ___ _ __ | |
\___ \| __/ _ \| '_ \| |
____) | || (_) | |_) |_|
|_____/ \__\___/| .__/(_)
| |
|_|
Modifying or tampering with this file is a violation of course policy.
If you're having trouble running the autograder, please contact the staff.
==============================================================================
"""
import bz2, base64
exec(bz2.decompress(base64.b64decode('QlpoOTFBWSZTWdih39cAOIdfgGAQXv///3////7////6YBw8O77vQuLswca4YBI7NZLHutHPAB7MCgN7qakpe8OqL3Xr2VexZtAqjAKxlmK0i1qhTuYB2A2jwkiI0CYIyE0BqYEZU/TRBptJqfqEeQmjTTTaTQGmhACEE0aaKNpqeiNlNMQZDTTEaAANAA000JNUTYSeoNMhoADR6RoaAAAHqB6jQBJpIk1CaaZKfqR6m0TamQGgNANGgPUAAAGhxkwTQyGRkZNDQBoMjCAaDRpkMQ0AEiIIJoAgAI00mnqU/1U/VPRkzKantUepoDQGmgadepO/2YGPrSUlQop/pKfktE0hWKCr6+64MQ/4yrEViMWCP7LU9DUYm05TFYoPx2drhFZtmxht0kDsSFQNfspWYnbmYizolWDAYp1ap/xmgt+iHIosSdpyi2XhYUlWWXnoZeCtt9CHBpfSUSVxKrfmtP19fKtJv493xyHCrjOY3ryD+NycdfX/LOxHTVUw6gJYKj9fjrj+rovzPe9HGXel/d3wJe8EhppDY2KooCoiiKCsYqAsVVgMzMMyp7ru9d68a7BirpGH5N0eDlfcyPTQUK5tgafvgfF1f59g5YnscIXKGLkoymGY07nSmTRmOI1qSxFu7ikwwcCsEcqrIbZiqqLM1lpvKDjGnXcMqNN5cZcoKqqqAqrJ6NB4cc3ZdhsodDUaQMlBOOlhL2YP+zepn6olqrmtIPZ583j+EOcL9L2OH1rMa9640yrPAP9k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