allcoding1
Photo
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int[] left = new int[n];
int[] right = new int[n];
for (int i = 0; i < n; i++) {
left[i] = scanner.nextInt();
right[i] = scanner.nextInt();
}
int sumLeft = 0;
int sumRight = 0;
for (int i = 0; i < n; i++) {
sumLeft += left[i];
sumRight += right[i];
}
if (sumLeft % 2 == 0 && sumRight % 2 == 0) {
System.out.println(0);
return;
}
boolean possible = false;
for (int i = 0; i < n; i++) {
int newSumLeft = sumLeft - left[i] + right[i];
int newSumRight = sumRight - right[i] + left[i];
if (newSumLeft % 2 == 0 && newSumRight % 2 == 0) {
possible = true;
break;
}
}
if (possible) {
System.out.println(1);
} else {
System.out.println(-1);
}
}
}
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int[] left = new int[n];
int[] right = new int[n];
for (int i = 0; i < n; i++) {
left[i] = scanner.nextInt();
right[i] = scanner.nextInt();
}
int sumLeft = 0;
int sumRight = 0;
for (int i = 0; i < n; i++) {
sumLeft += left[i];
sumRight += right[i];
}
if (sumLeft % 2 == 0 && sumRight % 2 == 0) {
System.out.println(0);
return;
}
boolean possible = false;
for (int i = 0; i < n; i++) {
int newSumLeft = sumLeft - left[i] + right[i];
int newSumRight = sumRight - right[i] + left[i];
if (newSumLeft % 2 == 0 && newSumRight % 2 == 0) {
possible = true;
break;
}
}
if (possible) {
System.out.println(1);
} else {
System.out.println(-1);
}
}
}
๐6
WNS is hiring Fresher
Apply link ๐
https://jobs.smartrecruiters.com/WNSGlobalServices144/743999933528002-associate-senior-associate-operations?trid=bb2572dc-93af-47bd-9bb1-9f049abba39c
Apply link ๐
https://jobs.smartrecruiters.com/WNSGlobalServices144/743999933528002-associate-senior-associate-operations?trid=bb2572dc-93af-47bd-9bb1-9f049abba39c
๐1
Telegram:- @allcoding1
Juspay
=int(input())
dic={}
def addnode(u,v):
dic[u].append(v)
for i in range(N):
n1=int(input())
dic[n1]=[]
edge=int(input())
for i in range(edge):
u,v=map(int,input().split())
addnode(u,v)
start=int(input())
end=int(input())
tr=[]
tr.append(start)
def traverse(dic,start):
for i in dic[start]:
if(i==end):
return
if(len(dic[start])==0):
return
else:
tr.append(i)
traverse(dic,i)
traverse(dic,start)
tr=sorted(tr)
for i in tr:
print(i,end=" ")
Juspay
=int(input())
dic={}
def addnode(u,v):
dic[u].append(v)
for i in range(N):
n1=int(input())
dic[n1]=[]
edge=int(input())
for i in range(edge):
u,v=map(int,input().split())
addnode(u,v)
start=int(input())
end=int(input())
tr=[]
tr.append(start)
def traverse(dic,start):
for i in dic[start]:
if(i==end):
return
if(len(dic[start])==0):
return
else:
tr.append(i)
traverse(dic,i)
traverse(dic,start)
tr=sorted(tr)
for i in tr:
print(i,end=" ")
โค1
๐1
WNS is hiring Fresher
Apply link ๐
https://jobs.smartrecruiters.com/WNSGlobalServices144/743999933528002-associate-senior-associate-operations?trid=bb2572dc-93af-47bd-9bb1-9f049abba39c
Apply link ๐
https://jobs.smartrecruiters.com/WNSGlobalServices144/743999933528002-associate-senior-associate-operations?trid=bb2572dc-93af-47bd-9bb1-9f049abba39c
๐3โค1
https://forms.office.com/pages/responsepage.aspx?id=N-edGDrJWk-LaG9MqZQZErhYpJunyJZKqf7OGiCnzjdUQ05CWkhPQUNUTU5TRzNGSUkxTlpOMzFXTC4u
#HCLTech is looking for experienced (6 to 24 months) or freshers SAP SD/MM/FICO (Global Certified) professionals.
ยท Highest Qualification for SAP- SD/MMโ B. Tech (CSE/IT/ ECE/EEE) Only.
ยท Job Title: Software Engineer/Software Developer
ยท Highest Qualification for SAP FICO - B.Com (Finance) Only.
ยท Batch: 2021/2022/2023/2024 Only.
ยท Must have 60% and above throughout the academics.
ยท CTC offered: as per the standard HCLTech grid applicable (Basis 60% Percentage Eligibility Criteria)
#HCLTech is looking for experienced (6 to 24 months) or freshers SAP SD/MM/FICO (Global Certified) professionals.
ยท Highest Qualification for SAP- SD/MMโ B. Tech (CSE/IT/ ECE/EEE) Only.
ยท Job Title: Software Engineer/Software Developer
ยท Highest Qualification for SAP FICO - B.Com (Finance) Only.
ยท Batch: 2021/2022/2023/2024 Only.
ยท Must have 60% and above throughout the academics.
ยท CTC offered: as per the standard HCLTech grid applicable (Basis 60% Percentage Eligibility Criteria)
๐7โค1
Accenture Hackdiva hiring 2023 &. 2024 Batch
Apply link
https://indiacampus.accenture.com/events/hackdiva/
Apply link
https://indiacampus.accenture.com/events/hackdiva/
๐1
Genpact is hiring 2022/2023/2024
Apply link
https://forms.office.com/pages/responsepage.aspx?id=IIrvvayqgE-zoNmjL5n9M9suui6swjBImu7iaOx00hhUQ0xRSkVTVFgwRjRVMEczWVkxRzRVN0VCTC4u
Apply link
https://forms.office.com/pages/responsepage.aspx?id=IIrvvayqgE-zoNmjL5n9M9suui6swjBImu7iaOx00hhUQ0xRSkVTVFgwRjRVMEczWVkxRzRVN0VCTC4u
Office
Please fill out this form