QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#22319. Statistik

Statistics

Die Kühe belegen elementare Statistik und haben Schwierigkeiten mit den Hausaufgaben. Hilf ihnen.

Berechne für $N$ $(1 \le $N$ \le 500)$ Zahlen $X_{i}$ $(-5,000 \le X_{i} \le 5000)$ zwei Statistiken:

  • Mittelwert: Summe geteilt durch $N$.
  • Median: bei ungeradem $N$ die mittlere sortierte Zahl, bei geradem $N$ Mittelwert der beiden mittleren.

Die Antwort gilt bei Abweichung höchstens0.002 vom offiziellen Wert als richtig.

Eingabe

  • Zeile1: ganze Zahl $N$.
  • Zeilen $2,\ldots,$N$+1$: Zeile $i+1$ enthält ganze Zahl $X_{i}$.

Ausgabe

  • Zeile1: Mittelwert der Eingabe.
  • Zeile2: Median der Eingabe.

Beispiele

Eingabe 1

5
12
4
6
8
2

Ausgabe 1

6.400000
6.000000

Hinweis

$(12+4+6+8+2)/5=6.4$. Die mittlere Zahl von {2, 4, 6, 8, 12} ist6.

Aufgabenautor: Traditional, 2008

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.