Created
April 11, 2016 15:32
-
-
Save bigblind/1a36801e7ef7bb4c07b4566c4b386dbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, math | |
inp = open("in.txt") | |
out = open("out.txt","w+") | |
sys.stdout = out | |
t = int(inp.readline()) | |
def print_case(case, result): | |
print "Case #%d: %s" % (case, str(result)) | |
for tc in xrange(t): | |
length, complexity, students = [int(x) for x in inp.readline().split()] | |
if complexity == 1 and students < length: | |
print_case(tc+1, "IMPOSSIBLE") | |
continue | |
if students < length - 1: | |
print_case(tc+1, "IMPOSSIBLE") | |
continue | |
if length == 1: | |
print_case(tc+1, "1") | |
continue | |
l = range(2, length+1) | |
print_case(tc+1, " ".join(map(str, l))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment