1506 - 不定方程
Time Limit : 1 秒
Memory Limit : 128 MB
求解方程ax+by=d的整数解,输出使|x|+|y|的值最小的那一组解。
Input
输入三个整数a,b,d。
Output
两个整数x和y。 若无解请输出No solution。
Examples
Input
1 3 2
Output
2 0
Input
1 -16 15
Output
-1 -1
Hint
对于100%的数据,-1e5<=a,b,d<=1e5。