안녕하세요. 오늘은 서로소가 싫을거예요.

문제

https://www.acmicpc.net/problem/30620

아이디어

x -> xy -> y

소스코드

#include <iostream>
using namespace std;

int main(void)
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    long long x, y;
    cin >> x >> y;
    cout << "2\n" << x * y - x << "\n" << y - x * y;
}


감사합니다!!

0개의 댓글