Questions: 1 680

Answers by our Experts: 1 680

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

You are given some coins. You have to take some coins from the given coins such that the sum of the coins

you took have a value strictly larger than the sum of the rest of the coins. However, you have to take

minimum number of coins while satisfying this condition

Input

In the first line, you are given n (n<=100), the number of integer numbers. In the next line, you will be given n integers, separated by spaces.

Output

Output one number, the minimum number of coins you need to take to have a larger sum than the sum of the

coins you did not take.

Input Output

2 2

3 3


3 2

2 1 2


6 2

4 2 1 2 1 1


In the first sample you will have to take 2 coins. If you take 1 coin, you get sum 3, 3. If you take 0 coins, you get

sums 0, 6. Those variants do not satisfy you as your sum should be strictly more than the other sum.

In the second sample one coin isn't enough for you, too. You can pick coins with values 1, 2 or 2, 2. In any case,

the minimum number of coins equals 2.

.


The file named called Purchase.txt contains product details such as item code, product name, price, quantity and cost of purchase. Write a C program to create a file to store the details of Purchase.txt (Use fscanf() and fprintf() functions).

The file named called EMPLOYEE.txt contains employee details such as employee number, name, designation and salary of employee. Write a program to create a file to store the details of employee (Use of structure and fwrite () & fread () functions)


Runtime Input :

101 xyz workshop 8500

102 nmo computer 6750

103 abc store 5890

Output :

101 xyz workshop 8500

102 nmo computer 6750

103 abc store 5890


Write a c program to calculate the average marks scored by the students in each subject using function
Write a C program to solve the given series using recursion
1+(2^x/2)+(4^x/4)+(8^x/8)+...
write a C program to convert the string "CEASER " to "HJFXJW "without using inbuilt function
write a C program to count the number of non zero elements in a two dimensional matrix using function with 2D array as an argument
Sample input:
input matrix: 12 17 0
100 0 1
5 4 0
Sample output:
No of non zero elements:6
determine the cumulative sum of n floating point numbers read a new number into the computer during each call to recursive function
Sample input:
n=3
Enter the number:0.8
Enter the number:0.1
Enter the number:0.2
Sample output:
Cumulative sum=1.1
given an input string Ayodhya your C program to count the number of vowels and consonants and print the frequency of occurrence of each vowel and consonant delete the vowels in the same input string and display the updated string
Sample input:
Enter the input string: Ayodhya
Sample output:
No of vowels:3
Frequency of occurrence:A-2;o-1
No of consonants:4
Frequency of occurrence:y-2;d-1;h-1
give a one dimensional array with positive integer values rearrange the array such that the odd numbers precede the even numbers
Sample input:
Numbers [10]={5,7,9,98,3,65,54,2,13,15}
Sample output:
Rearranged array={5,7,9,3,13,65,15,98,54,2}
LATEST TUTORIALS
APPROVED BY CLIENTS