Submission #493122
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
for(int i=0;i<t;i++){
int a,b,c;
cin>>a>>b>>c;
if(a<b){
swap(a,b);
}
if(c==a || c==b){
cout<<1<<endl;
}else{
int n=a/b;
int q=a%b;
if(c%b==0){
cout<<(2*c/b)<<endl;
//}else if(c%b==q){
}else if(0<n+(q-c)/b && n+(q-c)/b<n+1){
cout<<2*(n-c/b)<<endl;
}else{
cout<<-1<<endl;
}
}
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | E - Exact Number of Drops |
| User | mssn |
| Language | C++11 (GCC 4.8.1) |
| Score | 0 |
| Code Size | 493 Byte |
| Status | WA |
| Exec Time | 568 ms |
| Memory | 924 KiB |
Judge Result
| Set Name | All | ||||
|---|---|---|---|---|---|
| Score / Max Score | 0 / 1 | ||||
| Status |
|
| Set Name | Test Cases |
|---|---|
| All | 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 001.txt | AC | 26 ms | 732 KiB |
| 002.txt | WA | 28 ms | 780 KiB |
| 003.txt | WA | 376 ms | 800 KiB |
| 004.txt | WA | 568 ms | 796 KiB |
| 005.txt | WA | 553 ms | 800 KiB |
| 006.txt | WA | 406 ms | 800 KiB |
| 007.txt | WA | 549 ms | 736 KiB |
| 008.txt | WA | 520 ms | 924 KiB |