codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

1497C1.md (1072B)


      1 Source: https://codeforces.com/problemset/problem/1497/C1
      2 
      3 C1. k-LCM (easy version)
      4 
      5 time limit per test
      6 
      7 1 second
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 standard input
     16 
     17 output
     18 
     19 standard output
     20 
     21 It is the easy version of the problem. The only difference is that in this version $k = 3$.
     22 
     23 You are given a positive integer $n$. Find $k$ positive integers $a_1, a_2, \ldots, a_k$, such that:
     24 
     25 * $a_1 + a_2 + \ldots + a_k = n$
     26 * $LCM(a_1, a_2, \ldots, a_k) \le \frac{n}{2}$
     27 
     28 Here $LCM$ is the [least common multiple](https://en.wikipedia.org/wiki/Least_common_multiple) of numbers $a_1, a_2, \ldots, a_k$.
     29 
     30 We can show that for given constraints the answer always exists.
     31 
     32 Input
     33 
     34 The first line contains a single integer $t$ $(1 \le t \le 10^4)$  — the number of test cases.
     35 
     36 The only line of each test case contains two integers $n$, $k$ ($3 \le n \le 10^9$, $k = 3$).
     37 
     38 Output
     39 
     40 For each test case print $k$ positive integers $a_1, a_2, \ldots, a_k$, for which all conditions are satisfied.
     41 
     42 Example
     43 
     44 Input
     45 
     46 ```
     47 3
     48 3 3
     49 8 3
     50 14 3
     51 ```
     52 
     53 Output
     54 
     55 ```
     56 1 1 1
     57 4 2 2
     58 2 6 6
     59 ```