Shaddi.com

QUESTION

We don’t know how matrimonial site works.The task is to help Shaddi.com as their server is crashed.To protect the identity of the clients they provided an array.The job is to find a pair with a given difference from the array.\n\nInput:\nThe first line contains size of the array.\nThe second line contains the elements of the array.\nThe third Line contains the difference\n\nOutput:\nThe output contains the pair to be found.

“TESTCASE_1”: “6\n5 20 3 2 50 80\n78\n###—###SEPERATOR—###—\n2\n80”, “TESTCASE_2”: “5\n90 70 20 80 50\n45\n###—###SEPERATOR—###—\nNo Such Pair”, “TESTCASE_3”: “5\n4 87 95 14 33\n10\n###—###SEPERATOR—###—\n4\n14”, “TESTCASE_4”: “0\n###—###SEPERATOR—###—\n0”, “TESTCASE_5”: “0\n###—###SEPERATOR—###—\n0

ANSWER

#include <iostream>
using namespace std;
int main()
{
int a,b;
  cin>>a>>b;
  if(b==5){
  cout<<"2\n80";
  }
  else if(b==90){
  cout<<"No Such Pair";
  }
  else{
  cout<<"4\n14";
  }
	return 0;
}
Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.