LCM

AtCoder
IDarc200_b
Time2000ms
Memory256MB
Difficulty
You are given positive integers $A_1,A_2,A_3$. Determine whether there exists a pair of positive integers $(X_1,X_2)$ that satisfies all the following conditions, and if it exists, find one. * $X_1$ is an integer with $A_1$ digits in decimal notation. * $X_2$ is an integer with $A_2$ digits in decimal notation. * The least common multiple of $X_1$ and $X_2$ is an integer with $A_3$ digits in decimal notation. You are given $T$ test cases, so find the answer for each. ## Constraints * $1\le T\le 17^3$ * $1\le A_1,A_2,A_3\le 17$ * All input values are integers. ## Input The input is given from Standard Input in the following format: $T$ $\text{case}_1$ $\text{case}_2$ $\vdots$ $\text{case}_T$ Each test case is given in the following format: $A_1$ $A_2$ $A_3$ [samples]
Samples
Input #1
3
4 3 5
1 1 7
8 6 11
Output #1
Yes
2025 200
No
Yes
20250615 200200

For the first test case, if we set $(X_1,X_2)=(2025,200)$, then the least common multiple of $X_1,X_2$ is $16200$, which satisfies the conditions. Other examples that satisfy the conditions include $(X_1,X_2)=(2025,125),(7777,231)$.
API Response (JSON)
{
  "problem": {
    "name": "LCM",
    "description": {
      "content": "You are given positive integers $A_1,A_2,A_3$. Determine whether there exists a pair of positive integers $(X_1,X_2)$ that satisfies all the following conditions, and if it exists, find one. *   $X_1",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "arc200_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given positive integers $A_1,A_2,A_3$.\nDetermine whether there exists a pair of positive integers $(X_1,X_2)$ that satisfies all the following conditions, and if it exists, find one.\n\n*   $X_1...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments