結果
| 問題 |
No.2493 K-th in L2 with L1
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-10-06 21:36:19 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 529 bytes |
| コンパイル時間 | 3,277 ms |
| コンパイル使用メモリ | 251,216 KB |
| 最終ジャッジ日時 | 2025-02-17 04:54:32 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 4 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
void solve(){
int d,k;
cin>>d>>k;
if(d==0){
if(k==1){
cout<<"Yes\n";
cout<<"0 0\n";
}else{
cout<<"No\n";
}
return;
}
if(d*4<k){
cout<<"No\n";
return;
}
cout<<"Yes\n";
int mx=d*4;
mx-=4;
if(mx<k){
cout<<0<<" "<<d<<"\n";
return;
}
int ct=0;
while(mx>=k){
mx-=8;
ct++;
}
cout<<ct<<" "<<d-ct<<"\n";
}
int main(){
int t;
cin>>t;
rep(i,t) solve();
}