-
Notifications
You must be signed in to change notification settings - Fork 0
/
QuereProblemSet(Jozve Darsi).cs
53 lines (44 loc) · 1.19 KB
/
QuereProblemSet(Jozve Darsi).cs
1
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//https://quera.org/problemset/175189/
// input:
// 2
// 11 5 6 5
// output:
// 5 11
// input:
// 6
// 1 2 3 6 4 5 6 21
// output:
// 6 21
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Quera
{
class Program
{
static void Main(string[] args)
{
string NumSessions = Console.ReadLine();
string SizeSessions = Console.ReadLine();
Double[] DoubleSizeSessions = new Double[SizeSessions.Length];
string[] ChangedSizeSessions = SizeSessions.Split(' ');
for (int i = 0; i < ChangedSizeSessions.Length; i++)
{
if(ChangedSizeSessions[i] == "")
ChangedSizeSessions[i] = "0";
DoubleSizeSessions[i] = Convert.ToInt32(ChangedSizeSessions[i]);
}
// for (int i = 0; i < IntSizeSessions.Length; i++)
// {
// System.Console.WriteLine(IntSizeSessions[i]);
// }
Array.Sort(DoubleSizeSessions);
Double Sum = DoubleSizeSessions.Sum();
Double Final = DoubleSizeSessions[DoubleSizeSessions.Length-1];
Double Mid = Sum - (2*Final);
Console.WriteLine(Mid +" "+ Final);
}
}
}