ACCENTURE | COGNIZANT | IBM | CAPGEMINI
Kanalga Telegram’da o‘tish
Ko'proq ko'rsatish
7 349
Obunachilar
-324 soatlar
-207 kun
-10530 kun
Postlar arxiv
Internship Opportunity Alert
Company Name - Fractal
Job Role : Summer Intern
B.tech (all branches)
End Date: December 17, 2024 (9 hours left to apply)
🔗 Apply Link - https://internshipss.com/Fractal-Summer-Intern-2025.html
--------------------
Here we upload COMPANY OA coding questions only like CTS, ACCENTURE, CAPGEMINI...Etc👇👇👇
https://t.me/OA_CODING
GOT SELECTED FOR COGNIZANT & RECEIVED LOI 🥳🥳🥳🥳🥳
100% clearance for any exam and interview ✅
Contact: @mlcoder2
Infoedge is hiring for the role of Software Engineer (Java)
Experience: 1 - 3 year's
Expected CTC: 15 LPA - 25 LPA
Apply Link: https://forms.office.com/pages/responsepage.aspx?id=-bXpDrNSUUOBmMSATNZraOFYjL3xL9tIhDqT8JbyeMtUQzhOT1FBOVFZTjJMTjJDV0dYNzkzN0RWQS4u&route=shorturl
+2
Bottom line ON-CAMPUS exam ✅✅✅
44mcqs + 1 coding✅
Contact:@mlcoder2
HCL exam done successfully✅✅✅✅
90 mcqs ✅
Contact:@mlcoder2
Here we upload COMPANY OA coding questions only like CTS, ACCENTURE, CAPGEMINI...Etc👇👇👇
https://t.me/OA_CODING
Here we upload COMPANY OA coding questions only like CTS, ACCENTURE, CAPGEMINI...Etc👇👇👇
https://t.me/OA_CODING
import java.io.*;
import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int N=sc.nextInt();
int M=sc.nextInt();
int K=sc.nextInt();
int [] price=new int[N];
int[] protein=new int[N];
for(int i=0;i<N;i++){
price[i]=sc.nextInt();
}
for(int i=0;i<N;i++){
protein[i]=sc.nextInt();
}
int maxProtein = 0;
for (int mask = 0; mask < (1 << N); mask++) {
int[][] best= new int[N][2];
for (int i = 0; i < N; i++) {
best[i][0] = price[i];
best[i][1] = price[i] / 2;
}
PriorityQueue<int[]> pq = new PriorityQueue<>(
(a, b) -> (b[0] - b[1]) - (a[0] - a[1])
);
int currentPrice = 0;
int currentProtein = 0;
for (int i = 0; i < N; i++) {
if ((mask & (1 << i)) != 0) {
currentPrice +=best[i][0];
currentProtein += protein[i];
pq.add(new int[] {best[i][0], best[i][1]});
}
}
int coupons = 0;
while (coupons < K && !pq.isEmpty()) {
int[] option = pq.poll();
if (option[0] > option[1]) {
currentPrice -= (option[0] - option[1]);
coupons++;
}
}
if (currentPrice <= M) {
maxProtein = Math.max(maxProtein, currentProtein);
}
}
System.out.println(maxProtein);
}
}
//maximum protein value
