Reasoning
1. Yes
2. Puma
3. 18010
4. 2
5. Data in both 1 and 2 are necessary
6. Candidates is not to be selected
7. Harsh
8. UBPJDJQU
1. Yes
2. Puma
3. 18010
4. 2
5. Data in both 1 and 2 are necessary
6. Candidates is not to be selected
7. Harsh
8. UBPJDJQU
TCS NQT 2PM- AUGUST 20TH
1) no
2) puma
3. 18010
4. 2
5. Data in both 1 and 2 are necessary
6. Candidates is not to be selected
7. Harsh
8. UBPJDJQU
9 Both A and R is true BUT R is not correct explain of A
10.
Both A and R are true and R is correct explanation of A
1) no
2) puma
3. 18010
4. 2
5. Data in both 1 and 2 are necessary
6. Candidates is not to be selected
7. Harsh
8. UBPJDJQU
9 Both A and R is true BUT R is not correct explain of A
10.
Both A and R are true and R is correct explanation of A
N=int(input())
K=int(input())
price=list(map(int,input().split()))
vol=list(map(int,input().split()))
maxvol=0
volu=0
maxvol=max(vol)
for i in range(0,N):
if (maxvol==vol[i] and price[i]<=K):
K=K-price[i]
volu=maxvol
for i in range(0,N):
for j in range(i+1,N+1):
if (price[i]<=K and price[i]==price[j]):
if (vol[i]>vol[j]):
volu=volu+vol[i]
K=K-price[i]
else:
volu=volu+vol[j]
K=K-price[j]
elif (price[i]<=K and price[i]!=price[j]):
K=K-price[i]
volu=volu+vol[i]
print(volu)
K=int(input())
price=list(map(int,input().split()))
vol=list(map(int,input().split()))
maxvol=0
volu=0
maxvol=max(vol)
for i in range(0,N):
if (maxvol==vol[i] and price[i]<=K):
K=K-price[i]
volu=maxvol
for i in range(0,N):
for j in range(i+1,N+1):
if (price[i]<=K and price[i]==price[j]):
if (vol[i]>vol[j]):
volu=volu+vol[i]
K=K-price[i]
else:
volu=volu+vol[j]
K=K-price[j]
elif (price[i]<=K and price[i]!=price[j]):
K=K-price[i]
volu=volu+vol[i]
print(volu)
#include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
int arr[n];
for(int i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}
int count=0;
int num=arr[0];
for(int i=1;i<n;i++)
{
if(num!=arr[i])
count++;
}
printf("%d",count);
}
C Language
TCS 1st Qsn
Vijays code
Telegram - https://t.me/nqt_0
int main()
{
int n;
scanf("%d",&n);
int arr[n];
for(int i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}
int count=0;
int num=arr[0];
for(int i=1;i<n;i++)
{
if(num!=arr[i])
count++;
}
printf("%d",count);
}
C Language
TCS 1st Qsn
Vijays code
Telegram - https://t.me/nqt_0