# Challenges
Our challenges allow us measure coding skills, the ability to demonstrate problem solving skills is often more important than proving technical expertise in other areas, our programmers must understand that there is always more than one way to skin a cow
# Optimal Exchange
- Process Optimizations: Improve the runtime process
- Problem analysis: You must be able to understand and seek the best solution to problems
- Mathematics: Mathematics Operations
- Algorithms: Understanding Algorithms
# Description
The Exchange of currency of a random country has 'k' number of denominations. For each denomination, there is a coin.
Whenever a transaction happens with the cashier, to pay an amount 'X', you give exactly or some amount greater than 'X' ( let us say 'Y' ) to the cashier.
He then pays back the extra amount ( Y-X ) back to you. Both of you try to minimize the number of coins exchanged in the process. For example, if X = 68 and you have the denominations , 1,2,5,10,20,50, then the optimal transaction could be you paying the cashier 50+20 units ( 2 coins ) and then the cashier paying you back 2 units ( 1 coin ). Hence , the total number of coin exchanged in the process being 3 ( 50 + 20 - 2 ).
The efficiency of a set of denominations is calculated by the minimum number of coin exchange required for every integer coin value between 1 and N ( some upper bound, lets assume ) and taking their average as A. Lower the A, better is the set of denomination.
Write a program that, given a series of coins, calculates the average and maximum number of coins needed to pay any amount in the range [1,N]. You may assume that both parties involved have sufficient numbers of any coin at their disposal
# input
The first line contains the number of test cases. For each test case, there is a single line containing N ( 1<=N<=100 ),Number of denominations K( K<=10 ) and then the value of each denomination, all separated by a single space.
# Output
For each test case the output is a single line containing first the average and then the maximum number of coins involved in paying an amount in range [1,N]. The average should be accurate upto 2 decimal places.
# Sample Input
3
100 6 1 2 5 10 20 50
100 6 1 3 10 15 51 84
100 6 1 4 9 16 25 36
2
3
4
# Sample Output
2.96 5
2.56 3
2.85 5
2
3
# Alien invasion
- Matrices Operations: Understanding Matrices Operations
- Array: Understanding Vector Operations
- Mathematics: Mathematics Operations
- Algorithms: Understanding Algorithms
- Process Optimizations: Improve in to runtime process
# Description
While an unexpected alien invasion arrived to earth to exterminate the human race, the resistance has managed to know the shield's protection layers of their ships using an ultrasonic radar remaining at the atmosphere yet, the leader of the offensive battalion noticed that each layer has a rectangular form and has 1 or many command centers but if we can precisely target the middle from each one of them and hit them in sync, we could have a chance to destroy their ships
Unfortunately the mainframe in charge of decode the radar results was destroyed within the massive attack, and it's because of this that after several references one of the new recruits told us he could be able to make contact with you. THE BEST KNOWN HACKER UNTIL NOW. The world needs your help to decode the information generated by the radar so we could have an offensive advantage over the enemy who threaten to vanish the human race from the universe.
Thanks to an old images processor, we were able to transform the output from the radar to an information matrix with the layers bound within it. We need a program that allow us to aim with precision to each command center on each layer for all the ships that we give you in the following format
# Input
The 1st line of the input it's an integer N, being this the amount of ships you will need to process a solution for (1 <= N <= 30). Each ship will have 3 numbers at the first line X,Y they represent the ship dimensions, height and width respectively (4 <= {X,Y} <= 100) and Z that represent the scale for each value within the matrix. The following X lines are gonna be each row representation shown by the processor, each one of them will have Y elements separated with a blank with each W element being detection of the command center visible in that position, W will be whichever character on the following regex expression [a-zA-Z], you should notice that any other W character not recognized must be treated as an empty space.
# Output
Each line will be the position and shoot sequence for each enemy ship, in which all the command centers found are gonna be shown separated with a blank for each layer in depth order with each name and aim position in the following format, (W:Px,Py[;s])+ where W it's gonna be the name of the command center of that layer, Px his X central coordinate and Py his Y central coordinate both using the real scale round to 3 digits. Note that those layers that has more than 1 command center share the same entry separated by a ';' and sorted ascending by size (area) and alphabetical order.
# Sample Input
3
4 4 136.51
A B C C
D B C C
E E B D
E F F A
5 31 123.47
] [ G G G G G G G G G G G G G G G G G G G G G c c c c c h h ^
^ [ G G G G G G G G G G I I I G G G G G G G G K K K K Y Q Q t
\ ] G G f f o o U U U U U U U U U U U U U U U a a a a a M M M
\ ^ G G j j j j j j j j L L L j j j E E E E E j j j j j M M M
z B B B B B B B B B B B B B B B B B B B B B B B B C C d \ q s
21 20 93.61
[ \ ^ ] [ \ [ ] [ [ ] [ [ \ ] ^ \ ] [ ]
\ [ e e e e e e e e e e e e e ] ^ \ [ ^
^ S S S e e e e e e e e e e e b M M M M
s S S S e e e e e e e e e e e A A M Q Q
s S S S e e e e e e e e e k k k k k k Q
s S S S e e e e e e e e e k k k k k k Q
s S S S z l l l l l z z w k k k k k k Q
s S S S z l J J l l z z w k k k k k k Q
s S S S z l J J l l z z w k k k k k k Q
g S S S g l J P P P P P P P P P P P P P
g S S S g l J P P P P P P P P P P P P P
g S S S g o J P P P P P P P P P P P P P
s S S S z o J P P P P P P P P P P P P P
s S S S K L J P P P P P P P P P P P P P
s S S S c L J P P P P P P P P P P P P P
s S S S c L J P P P P P P P P P P P P P
s z z z X L J P P P P P P P P P P P P P
s s s s c L J P P P P P P P P P P P P P
s s s s c L J P P P P P P P P P P P P P
[ R R R R R J J n t q q q q q q G G q N
[ [ ^ \ \ ^ ^ [ v v v v \ ] ] \ G G ] \
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Sample Output
F:477.785,273.020;C:136.510,409.530 E:409.530,136.510 B:204.765,273.020 D:273.020,273.020 A:273.020,273.020
Y:185.205,3395.425;d:555.615,3395.425;q:555.615,3642.365;s:555.615,3765.835;t:185.205,3765.835;z:555.615,61.735;C:555.615,3210.220;Q:185.205,3580.630;f:308.675,617.350;h:61.735,3580.630;o:308.675,864.290;I:185.205,1666.845;L:432.145,1666.845;K:185.205,3086.750;E:432.145,2531.135;a:308.675,3148.485;c:61.735,3148.485;M:370.410,3642.365;U:308.675,1913.785;B:555.615,1605.110
j:432.145,1975.520 G:246.940,1543.375
K:1263.735,421.245;N:1825.395,1825.395;X:1544.565,421.245;b:234.025,1450.955;n:1825.395,795.685;t:1825.395,889.295;A:327.635,1497.760;o:1123.320,514.855;w:702.075,1170.125;G:1872.200,1591.370;v:1919.005,936.100;R:1825.395,327.635;L:1497.760,514.855;k:608.465,1497.760;S:842.490,234.025;P:1310.540,1263.735
c:1544.565,421.245;q:1825.395,1357.345;Q:561.660,1778.590;g:982.905,234.025;J:1263.735,655.270;e:327.635,795.685
M:280.830,1684.980;l:795.685,702.075 z:1076.515,608.465 s:1029.710,187.220
2
3
4
5
6
# Ranking
# Optimal Exchange
- +Y 89% All Cases
- +JS 85% Some Cases
- +J 80% All Cases
# Alien invasion
- +Y 85% All Cases