링크 : https://school.programmers.co.kr/learn/courses/30/lessons/42842
#include <string>
#include <vector>
using namespace std;
vector<int> solution(int brown, int yellow) {
vector<int> answer;
int num = brown + yellow;
int i = 3;
while(1){
if(i*i == num){
answer.push_back(i);
answer.push_back(i);
return answer;
}
else if(i*i >= num && ((i - 2) * ((num/i) - 2) == yellow) && i*(num/i) == num) break;
i++;
}
while(1){
if(num % i == 0){
answer.push_back(i);
answer.push_back(num/i);
break;
}
else i++;
}
return answer;
}