COGNIZANT EXAM HELP GROUP
3.55K subscribers
5.3K photos
21 videos
10 files
3.22K links
🚀 Placement Preparation Hub

🎓 From Preparation to Placement

OA Support • Coding • Aptitude • Technical • HR

🌟 Trusted by Hundreds of Students

🏆 372+ Placement Successes

📩 DM: @Mrtrueliving_ix

💙 Turning Aspirations into Offer Letters.
Download Telegram
Flipkart SDE codes available

DM @mrtrueliving_ix 👍
Please open Telegram to view this post
VIEW IN TELEGRAM
def can_rob_all(houses, H, K):
return sum((house + K - 1) // K for house in houses) <= H

def main():
import sys
input = sys.stdin.read
data = list(map(int, input().split()))

N, H = data[0], data[1]
A = data[2:2+N]

left, right = 1, max(A)

while left < right:
mid = (left + right) // 2
if can_rob_all(A, H, mid):
right = mid
else:
left = mid + 1

print(left)

main()

Rechile World // Flipkart
#include <iostream>
#include <vector>

double calculateHouseTax(int income) {
if (income < 50000) {
return income * 0.1;
} else if (income < 100000) {
return 5000 + (income - 50000) * 0.2;
} else {
return 5000 + 10000 * 0.2 + (income - 100000) * 0.3;
}
}

double calculateTax(std::vector<std::pair<int, int>> houses, std::vector<int> specialHouses) {
double totalTax = 0;
for (auto& house : houses) {
int index = house.first;
int income = house.second;
if (index == specialHouses[0]) {
continue;
} else if (index == specialHouses[1]) {
totalTax += calculateHouseTax(income) * 2;
} else if (index == specialHouses[2]) {
totalTax += calculateHouseTax(income) * 0.9;
} else {
totalTax += calculateHouseTax(income);
}
}
return totalTax;
}

int main() {
int n;
std::cin >> n;
std::vector<int> specialHouses(3);
for (int i = 0; i < 3; i++) {
std::cin >> specialHouses[i];
}
std::vector<std::pair<int, int>> houses(n);
for (int i = 0; i < n; i++) {
std::cin >> houses[i].first >> houses[i].second;
}
if (n) {
std::cout << (int)calculateTax(houses, specialHouses) << std::endl;
} else {
std::cout << -1 << std::endl;
}
return 0;
}

Tax collection// Flipkart
import math

def prime(x):
if x <= 1:
return False
for i in range(2, int(math.sqrt(x)) + 1):
if x % i == 0:
return False
return True

def run():
a, b = map(int, input().split())
c = 0

for n in range(a, b + 1):
if prime(n - 1) and prime(n + 1):
c += 1

print(c)
run()
Prime// Flipkart
Deloitte exam answers

@code_alphix

Start
Deloitte

On campus placement

All MCQs are done

DM
@mrtrueliving_ix 👍

Any placement help available with remote access
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM