1942A - Farmer John's Challenge - CodeForces Solution


constructive algorithms

Please click on ads to support us..

Python Code:

t=int(input(""))
for i in range(t):
            n,k= map(int, input("").split())
        ans=[]
    if k==n:
        print(*[1]*n)
    elif k==1:
        ans=[n]
        for i in range(1,n):
            ans.append(i)
        print(*ans)
    else:
        print(-1)
        


Comments

Submit
0 Comments
More Questions

1547F - Array Stabilization (GCD version)
358A - Dima and Continuous Line
1385C - Make It Good
651A - Joysticks
1474D - Cleaning
1588A - Two Arrays
816A - Karen and Morning
9D - How many trees
918B - Radio Station
15A - Cottage Village
1737B - Ela's Fitness and the Luxury Number
1425H - Huge Boxes of Animal Toys
1737A - Ela Sorting Books
768C - Jon Snow and his Favourite Number
1006C - Three Parts of the Array
81A - Plug-in
276C - Little Girl and Maximum Sum
1738D - Permutation Addicts
1348B - Phoenix and Beauty
186A - Comparing Strings
1281A - Suffix Three
1421C - Palindromifier
1443A - Kids Seating
963A - Alternating Sum
1191B - Tokitsukaze and Mahjong
1612G - Max Sum Array
1459B - Move and Turn
1006F - Xor-Paths
706C - Hard problem
304C - Lucky Permutation Triple