QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#639602 | #7781. Sheep Eat Wolves | HSTKwow | RE | 0ms | 3688kb | C++14 | 460b | 2024-10-13 20:44:37 | 2024-10-13 20:44:39 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
using namespace std;
typedef long double ld;
typedef pair<int,int> pii;
const int N = 2e5+10;
signed main(){
IOS;
int x,y,p,q;
cin>>x>>y>>p>>q;
if(x+p+q<y){
cout<<-1<<endl;
}else{
int pcnt=(p+q)/2;
int ans=x/pcnt;
ans=ans*2-1;
cout<<ans<<endl;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3688kb
input:
4 4 3 1
output:
3
result:
ok 1 number(s): "3"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
3 5 2 0
output:
5
result:
ok 1 number(s): "5"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3684kb
input:
2 5 1 1
output:
-1
result:
ok 1 number(s): "-1"
Test #4:
score: -100
Runtime Error
input:
1 1 1 0