Task: | Kasat |
Sender: | |
Submission time: | 2015-09-12 21:19:26 +0300 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.05 s | 1 | details |
#2 | WRONG ANSWER | 0.06 s | 2 | details |
#3 | WRONG ANSWER | 0.06 s | 3 | details |
Code
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(int argc, char** argv) { int t; long a, b, c, n; cin >> t; vector<vector<int> > v; vector<int> vv; for (int i = 0; i < t; ++i){ cin >> a >> b >> c >> n; long kasat[3] = {a, b, c}; sort(kasat, kasat+3); long x = n > (kasat[1] - kasat[0]) ? (kasat[1] - kasat[0]) : n; kasat[0] += x; kasat[2] -= x; n -= x; x = n > 0 ? (kasat[2] - kasat[0]) : 0; kasat[0] += x/2 - n%2; kasat[1] += x/2; kasat[2] -= x/2 + x/2 - n%2; for (int j = 0; j < 3; ++j) vv.push_back(kasat[j]); v.push_back(vv); } for (int i = 0; i < t; ++i){ cout << v.at(i).at(0) << " " << v.at(i).at(1) << " " << v.at(i).at(2) << "\n"; } return 0; }
Test details
Test 1
Group: 1
Verdict: WRONG ANSWER
input |
---|
1000 7 69 64 45 37 5 30 81 50 49 37 38 46 37 100 6 ... |
correct output |
---|
46 47 47 24 24 24 45 45 46 43 46 94 32 32 33 ... |
user output |
---|
52 64 24 52 64 24 52 64 24 52 64 24 52 64 24 ... |
Test 2
Group: 2
Verdict: WRONG ANSWER
input |
---|
1000 19 13 88 978977859 67 57 39 960003440 81 16 67 971611942 92 96 2 957979201 ... |
correct output |
---|
39 40 41 54 54 55 54 55 55 63 63 64 36 37 38 ... |
user output |
---|
49 50 21 49 50 21 49 50 21 49 50 21 49 50 21 ... |
Test 3
Group: 3
Verdict: WRONG ANSWER
input |
---|
1000 211358104 753479603 549127067 ... |
correct output |
---|
504654924 504654925 504654925 589019272 589019272 589019273 101309993 101309994 101309994 436205296 436205297 436205298 351062567 351062568 351062568 ... |
user output |
---|
482418854 482418854 549127066 482418854 482418854 549127066 482418854 482418854 549127066 482418854 482418854 549127066 482418854 482418854 549127066 ... |