#include
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a ,b;
cin>>a>>b;
int t=a-b;
int k=t%10;
if(k==0)
t+=1;
else
t-=1;
cout<<t;
return 0;
}
#include
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a ,b;
cin>>a>>b;
int t=a-b;
int k=t%10;
if(k==0)
t+=1;
else
t-=1;
cout<<t;
return 0;
}
Yes. As it stands you can end up with an answer that is zero, which is not a positive integer as specified.
This is also specifically mentioned in the Editorial for this problem. Search the discussion board for “CIELAB” to find it.