Submission #17623071


Source Code Expand

Copy
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main(N, M):
    if N == 1 and M == 0:
        print(1, 2)
        return
    if not 0 <= M < N - 1:
        print(-1)
        return
    if M == 0:
        for i in range(N):
            print(2 * i + 1, 2 * i + 2)
        return
    X = 10**6
    for i in range(M + 1):
        print(X + 2 * i + 1, X + 2 * i + 2)
    for i in range(N - M - 1):
        print(X - i - 1, X + X + i + 1)

N, M = map(int, readline().split())

main(N, M)

Submission Info

Submission Time
Task C - Solutions
User maspy
Language Python (3.8.2)
Score 500
Code Size 581 Byte
Status AC
Exec Time 161 ms
Memory 9044 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 2
AC × 54
Set Name Test Cases
Sample 00-Sample-00, 00-Sample-01
All 00-Sample-00, 00-Sample-01, 01-N103497M97981, 01-N10M-1, 01-N10M-10, 01-N10M-2, 01-N10M-3, 01-N10M-4, 01-N10M-5, 01-N10M-6, 01-N10M-7, 01-N10M-8, 01-N10M-9, 01-N10M0, 01-N10M1, 01-N10M10, 01-N10M2, 01-N10M3, 01-N10M4, 01-N10M5, 01-N10M6, 01-N10M7, 01-N10M8, 01-N10M9, 01-N11431M1531, 01-N123857M109412, 01-N133447M71060, 01-N139679M46985, 01-N161868M156803, 01-N163982M79925, 01-N168417M143637, 01-N1M0, 01-N200000M-1, 01-N200000M-100000, 01-N200000M-200000, 01-N200000M0, 01-N200000M1, 01-N200000M100000, 01-N200000M199998, 01-N200000M199999, 01-N200000M2, 01-N200000M200000, 01-N23355M10651, 01-N24593M15890, 01-N31932M26393, 01-N36426M9434, 01-N36991M31877, 01-N48772M22606, 01-N60522M40319, 01-N63340M21398, 01-N7775M948, 01-N86918M73878, 01-N87940M11203, 01-N95728M66299
Case Name Status Exec Time Memory
00-Sample-00 AC 19 ms 8948 KB
00-Sample-01 AC 25 ms 8868 KB
01-N103497M97981 AC 94 ms 8904 KB
01-N10M-1 AC 18 ms 8808 KB
01-N10M-10 AC 20 ms 8868 KB
01-N10M-2 AC 25 ms 9016 KB
01-N10M-3 AC 21 ms 8956 KB
01-N10M-4 AC 21 ms 8772 KB
01-N10M-5 AC 20 ms 8960 KB
01-N10M-6 AC 19 ms 8868 KB
01-N10M-7 AC 20 ms 8888 KB
01-N10M-8 AC 21 ms 8804 KB
01-N10M-9 AC 18 ms 8876 KB
01-N10M0 AC 28 ms 8804 KB
01-N10M1 AC 20 ms 8824 KB
01-N10M10 AC 19 ms 9012 KB
01-N10M2 AC 24 ms 8812 KB
01-N10M3 AC 26 ms 8876 KB
01-N10M4 AC 18 ms 8808 KB
01-N10M5 AC 21 ms 8940 KB
01-N10M6 AC 21 ms 8812 KB
01-N10M7 AC 19 ms 8888 KB
01-N10M8 AC 21 ms 8864 KB
01-N10M9 AC 19 ms 8868 KB
01-N11431M1531 AC 34 ms 8844 KB
01-N123857M109412 AC 106 ms 8836 KB
01-N133447M71060 AC 111 ms 8972 KB
01-N139679M46985 AC 115 ms 8840 KB
01-N161868M156803 AC 134 ms 8908 KB
01-N163982M79925 AC 131 ms 8972 KB
01-N168417M143637 AC 134 ms 8996 KB
01-N1M0 AC 21 ms 8976 KB
01-N200000M-1 AC 19 ms 8948 KB
01-N200000M-100000 AC 19 ms 8808 KB
01-N200000M-200000 AC 21 ms 8804 KB
01-N200000M0 AC 148 ms 9020 KB
01-N200000M1 AC 146 ms 9000 KB
01-N200000M100000 AC 159 ms 8836 KB
01-N200000M199998 AC 161 ms 8888 KB
01-N200000M199999 AC 23 ms 8952 KB
01-N200000M2 AC 154 ms 8872 KB
01-N200000M200000 AC 27 ms 8868 KB
01-N23355M10651 AC 41 ms 8968 KB
01-N24593M15890 AC 44 ms 8920 KB
01-N31932M26393 AC 48 ms 8812 KB
01-N36426M9434 AC 49 ms 9004 KB
01-N36991M31877 AC 51 ms 8800 KB
01-N48772M22606 AC 55 ms 8832 KB
01-N60522M40319 AC 68 ms 9044 KB
01-N63340M21398 AC 67 ms 8836 KB
01-N7775M948 AC 34 ms 8816 KB
01-N86918M73878 AC 84 ms 8836 KB
01-N87940M11203 AC 82 ms 8916 KB
01-N95728M66299 AC 87 ms 8968 KB