JPMorgan ChaseOA #10
Tracks in Hackathon
估计简单可在线判题
考点(AI 标注)位运算
Each person belongs to exactly one team, and each team has either a or b people. Split all p people into teams and find the minimum number of teams; output −1 if it is impossible.
输入格式
One line with a b p; full original bounds 1≤a,b,p≤100000.
输出格式
Output a single integer answer.
样例 1
输入:
3 4 7
输出:
2
样例 2
输入:
4 6 7
输出:
-1
样例 3
输入:
1 100 100
输出:
1
样例说明
The outputs of the three public examples are, in order: 2; -1; 1. These answers have been checked by independent enumeration or direct simulation.