My issue
how to solve it
any hint??
Learning course: Logic Building in Python
Problem Link: CodeChef: Practical coding for everyone
how to solve it
any hint??
Learning course: Logic Building in Python
Problem Link: CodeChef: Practical coding for everyone
Your problem is that you have given two integers A & C and you need to find the average of both , which is integer B and B must follow some conditions like (1). B should be the average of A & C , (2). B must be an integer (not contain float value) .
In such case if your output B is no integer (means it come in float value) then you should print “-1”.
For Example :- For A = 3 and C = 4, the output of B is “-1”
Explanation :- Above output is correct because For A = 3 and C = 4, the output of B is “-1”, as the average of 3 and 4 which is 3.5 but it is not an integer so the answer is “-1”.