Demo entry 6643349

aakash ravi

   

Submitted by anonymous on Sep 27, 2017 at 18:04
Language: Python 3. Code size: 493 Bytes.

def cleanup(case):
    n, m = map(int, input().split())
    cJobs = {int(x) for x in input().split()}
    tJobs = {x for x in range(1,n+1)}
    rJobs = tJobs.difference(cJobs)
    chefJobs = []
    assistJobs = []
    for i, x in enumerate(rJobs):
        if i%2 == 1:
            assistJobs.append(x)
        else:
            chefJobs.append(x)
    
    print(*chefJobs, sep=' ')
    print(*assistJobs, sep=' ')

T = int(input())
for i in range(T):
    cleanup(i)
    

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).