codefoces-A. Pens and Pencils
题意简单:
两门课程,一门是实际课,一门是理论课,两种笔,一种是钢笔,另一种是铅笔,另用一个盒子装这两种笔。没门课使用对应的笔,不能随便用其它的笔,每门课需要用a,
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string.h>
#include<math.h>
#define ll long long
#define mem(a,b) memset(a,b,sizeof(a))
const int MM=1e6+5;
using namespace std;
int t;
int a,b,c,d,k;
int main()
{
cin>>t;
while(t--)
{
int sum=0,ans=0;
cin>>a>>b>>c>>d>>k;
if(c>=a)
sum+=1;
else{
sum+=a/c;
if(a%c!=0)
sum++;
}
if(d>=b)
ans+=1;
else{
ans+=b/d;
if(b%d!=0)
ans++;
}
if((ans+sum)<=k)
cout<<sum<<" "<<ans<<endl;
else
cout<<"-1"<<endl;
}
return 0;
}