Wrong answer , even when custom output is right

I’m a beginner, just started to solve my first problem in CCSTART2 contest - problem “BUYPLSE”
question link CodeChef: Practical coding for everyone
my solution -
#include
using namespace std;

int main() {
int a,x,b,y;
cin >> a >> x >> b >> y;
cout << a * x + b * y;
return 0;
}

what I’m doing wrong?..please help…

Your solution gives the wrong output for Sample Input 2 :slight_smile:

ohh :sweat_smile:
that was silly mistake… :sweat_smile: I should have read the question carefully…
thanks btw…@ssjgz

1 Like

Check input in question
And header file is incomplete
its #include

Timely reminder to format your code or (better!) link to your submission :slight_smile: Also, lol that the “correction” is exactly as wrong as the thing it’s correcting XD

2 Likes

The input values are in the wrong order.

Yes , that was the problem… thanks @code_zee

Actually it was typing mistake here…but it was correct in the submission…and yes the input order was wrong… thanks @pra2923