总时间限制:
1000ms
内存限制:
65536kB
描述
Find the minimum positive number A, so that both A and (M minus A) are divisors of N.
输入
Two positive integers N (N <= 10000) and M (M <= 10000).
输出
Two integers A and (M-A).
样例输入
20 9
样例输出
4 5
#include<bits/stdc++.h>//Writed by Wangzhimin Date: 2022.06.02
using namespace std;
int num,k,a[205];
int main()
{
scanf("%d%d",&num,&k);
int cnt=0;
for(int i=1;i<num;i++)
if(num%i==0&&num%(k-i)==0)//是要求的吧
{
cout<<i<<" "<<k-i;
break;
}
return 0;
}