Beruflich Dokumente
Kultur Dokumente
For example if a person has 3 children and his salary is 100, his
final salary will be of 84.15.
First step: 100 - 100 * 0.15 = 85
Second step: 85 - 85 * 0.01 = 84.15
You can assume there will always be at least 3 people in the list
that fulfill the conditions requested above and there won't be
ties.
Input Format
Input is already parsed by us. The format is only
important if you want to use the ‘Custom input’ option.
The first line contains an integer, n, denoting the number of
people.
For each person there will be 5 lines, one for each feature in the
order they appear above.
Constraints
1 ≤ n ≤ 106
1 ≤ salary ≤ 106
civil status ∈ {divorced, single, widowed}
0 ≤ number of children ≤ 5
20 ≤ age ≤ 60
Output Format
The function must return the id of third person with best salary.
Sample Input 0
5
1
100
2
single
32
2
1000
2
single
30
3
10000
3
single
40
4
1000000
2
single
39
5
12
1
divorced
34
Sample Output 0
Maths Easy
Constraints
n>0
Input Format
Important: input is already parsed by us. The format is only
important if you want to use the ‘Custom input’ option.
Input consists of one integer number, denotingn.
Output Format
Return an integer number equal to the amount offour digit
numbers divisible by n that are not palindromes.
Sample Input 0
4000
Sample Output 0
Sample Input 1
2002
Sample Output 1
0
Arrays Easy
You are given a list of n numbers, and you must return the most
repeated one. If there is more than one, then return the smallest
one.
Input Format
Important: input is already parsed by us. The format is only
important if you want to use the ‘Custom input’ option.
Constraints
1 ≤ n ≤ 106
0 ≤ xi ≤ 109
Output Format
The function must return the smallest among the most repeated
numbers.
Sample Input 0
4
1
2
3
3
Sample Output 0
Sample Input 1
9
1
2
3
1
2
3
4
2
3
Sample Output 1
Sample Input 2
5
0
0
1
1
2
Sample Output 2
Easy OOP
Local phone calls: both caller and receiver are in the same
city
National phone calls: caller and receiver are in different
cities, but in the same country
International phone calls: caller and receiver are in different
countries
Our plans used to allow only local phone calls, and we want to
add both national and international to them. To do this, we need
to upgrade the software. Here is how each type of phone call
should be billed:
Input Format
Important: input is already parsed by us. The format is only
important if you want to use the ‘Custom input’ option.
Constraints
1 ≤ n ≤ 5 * 104
0 ≤ phone call durations ≤ 104
Cities names are in { Buenos Aires, Rosario, Viedma, Cusco,
Lima, Ayacucho, Rio de Janeiro, Belo Horizonte, Recife }
Buenos Aires, Rosario and Viedma are cities in Argentina.
Cusco, Lima and Ayacucho are cities in Peru.
Rio de Janeiro, Belo Horizonte and Recife are cities in Brazil.
All calls are measured in seconds
Output Format
The function must return n lines where the ith line has the total
cost of the ith call.
Sample Input 0
1
Buenos Aires
Buenos Aires
10
Sample Output 0
10
Sample Input 1
3
Cusco
Rio de Janeiro
Viedma
Cusco
Rio de Janeiro
Viedma
0
100
10000000
Sample Output 1
0
100
10000000
Sample Input 2
2
Buenos Aires
Rio de Janeiro
Rosario
Recife
50
61
Sample Output 2
10
11
Sample Input 3
2
Viedma
Lima
Cusco
Belo Horizonte
30
610
Sample Output 3
600
9150
Constraints:
1 ≤ N ≤ 106
Output Format
The function must return an integer, the number representing
the android.
Maths
Input Format
The input consists of a float between 0 and 100 with one decimal
place.
Output Format
The function must return an integer greater than 0.
Sample input 0
33.3
Sample output 0
Sample input 1
33.4
Sample output 1
287
Input Format
Input is already parsed by us. The format is only
important if you want to use the ‘Custom input’ option.
The first line contains an integer, n, denoting the number of
taxpayers.
The second line contains an integer, k, denoting George's
unlucky number.
Constraints
1 ≤ n ≤ 2 × 1012
1 ≤ k ≤ 4 × 1015
Output Format
The function must return an integer denoting the
maximum amount of money George can collect by visiting the
taxpayers in order of sequential ID number and ensuring that the
current sum of money collected is never equal to k. As the
answer could be large, return answer % (109 + 7). This is printed
to stdout by locked stub code in the editor.
Sample Input 0
2
2
Sample Output 0
Explanation 0
George visits the following sequence of n = 2 taxpayers:
1. George collects 1 dollar from taxpayer 1 to get sum = 1.
2. George collects 2 dollars from taxpayer 2 to get sum = 1 + 2
= 3; observe that he collected a maximum amount of money
and avoided having exactly k = 2 dollars.
Sample Input 1
2
1
Sample Output 1
Explanation 1
George visits the following sequence of n = 2 taxpayers:
1. George will not collect 1 dollar from taxpayer 1 because k =
1 and he refuses to have asum ≡ k at any time.
2. George moves on and collects 2 dollars from taxpayer 2 to
get sum = 0 + 2 = 2.
Sample Input 2
3
3
Sample Output 2
Explanation 2
George must skip some taxpayer because collecting from all
taxpayers will result in a sum ≡ k = 3 when he collects from the
second taxpayer. There are two ways for him to visit all n = 3
taxpayers:
He can collect 1 dollar from taxpayer 1 to get sum = 1. Next,
he can refuse to collect 2 dollars from taxpayer 2 to avoid
having a sum equal to k. Next, he can collect 3 dollars from
taxpayer 3 to get sum = 1 + 3 = 4.
He can refuse to collect 1 dollar from taxpayer 1, meaning
that sum = 0. Next, he can collect 2 dollars from taxpayer 2
to get sum = 0 + 2 = 2. Next, he can collect 3 dollars from
taxpayer 3 to get sum = 2 + 3 = 5.
Because we want the maximum amount of money that George
can collect from his sequentially-numbered taxpayers without
ever having a sum equal to k, we return 5 as our answer.
Input format
Important: input is already parsed by us. The format is only
important if you want to use the ‘Custom input’ option.
The first line contains the amount of friends,N, and the amount
of loans, L. Each friend will be referenced by a number between
0 and N-1 .
Each of the following L lines contains three integers describing a
loan: the friend who lended, the friend who borrowed, and the
amount of money.
Constraints
1 ≤ N ≤ 106
1 ≤ L ≤ 106
Output Format
The function must return a list of transfers to pay off all the
debts, minimizing the amount of money being transferred
among the group.
Sample input 0
3 4
0 1 1
1 2 1
0 2 1
2 0 2
Sample output 0
Sample input 1
4 4
0 2 2
1 2 4
1 3 3
0 3 1
Sample output 1
3
203
213
314