302419: CF466B. Wonder Room
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Wonder Room
题意翻译
## 题目描述 伴随着新学年的开始,学生们在宿舍住宿出现了问题。其中每一间宿舍有一个 $a\times b$ 平方米的房间。宿管想在那里正好容纳 $n$ 个学生。但学校的要求规定,每个学生的房间必须至少有 $6$ 平方米(也就是说,$n$ 名学生的房间必须至少有 $6n$ 平方米的面积)。宿管可以将房间的任何一侧(可能是两侧)扩大任意正整数米。请你帮助他扩建房间,使 $n$ 个学生都能住在里面,且使房间的总面积尽可能小。 ------------ ## 输入格式 第一行包含三个空格分隔的整数 $n$,$a$ 和 $b$( $1\le n$,$a$,$b\le 10^9$ )$n$ 表示学生人数,$a$ 和 $b$ 表示每间宿舍规模大小 ## 输出格式 输出三个整数 $s$,$a_1$,$b_1$$(a\le a_{1},b\le b_{1})$表示房间的最终面积大小以及其大小规模,若存在多个解,输出其中任何一个解即可。题目描述
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a $ a×b $ square meter wonder room. The caretaker wants to accommodate exactly $ n $ students there. But the law says that there must be at least 6 square meters per student in a room (that is, the room for $ n $ students must have the area of at least $ 6n $ square meters). The caretaker can enlarge any (possibly both) side of the room by an arbitrary positive integer of meters. Help him change the room so as all $ n $ students could live in it and the total area of the room was as small as possible.输入输出格式
输入格式
The first line contains three space-separated integers $ n $ , $ a $ and $ b $ ( $ 1<=n,a,b<=10^{9} $ ) — the number of students and the sizes of the room.
输出格式
Print three integers $ s $ , $ a_{1} $ and $ b_{1} $ $ (a<=a_{1}; b<=b_{1}) $ — the final area of the room and its sizes. If there are multiple optimal solutions, print any of them.
输入输出样例
输入样例 #1
3 3 5
输出样例 #1
18
3 6
输入样例 #2
2 4 4
输出样例 #2
16
4 4