結果

問題 No.2845 Birthday Pattern in Two Different Calendars
ユーザー moon17
提出日時 2024-08-23 23:23:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 433 bytes
コンパイル時間 307 ms
コンパイル使用メモリ 82,400 KB
実行使用メモリ 87,016 KB
最終ジャッジ日時 2024-08-23 23:23:16
合計ジャッジ時間 6,045 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
  k,m,n=map(int,input().split())
  if m==1:
    print('No')
    continue
  s=[0]*(k+1)
  t=0
  ans=[]
  i=1
  for _ in range(k):
    j=(i+m-2)%k+1
    if s[i]==s[j]==0:
      s[i]=s[j]=1
      t+=1
      ans+=i,
      i=j+1
      if i==k+1:
        i=1
    else:
      i+=1
      if i==k+1:
        i=1
    if t==n:
      break
  if t==n:
    print('Yes')
    print(*sorted(ans))
  else:
    print('No')
0