From a5ee586185677dbb3a11686762412fad02147bc2 Mon Sep 17 00:00:00 2001 From: Denis Costa Date: Tue, 24 Sep 2024 20:43:08 -0300 Subject: [PATCH] Solve Internship in python --- solutions/beecrowd/2533/2533.py | 13 + solutions/beecrowd/2533/generate_in.sh | 16 + solutions/beecrowd/2533/imgs/estagio_fig.png | Bin 0 -> 888 bytes solutions/beecrowd/2533/in.txt | 21083 +++++++++++++++++ solutions/beecrowd/2533/out.txt | 1000 + solutions/beecrowd/2533/problem.md | 37 + solutions/beecrowd/2533/tags.txt | 1 + 7 files changed, 22150 insertions(+) create mode 100644 solutions/beecrowd/2533/2533.py create mode 100755 solutions/beecrowd/2533/generate_in.sh create mode 100644 solutions/beecrowd/2533/imgs/estagio_fig.png create mode 100644 solutions/beecrowd/2533/in.txt create mode 100644 solutions/beecrowd/2533/out.txt create mode 100644 solutions/beecrowd/2533/problem.md create mode 100644 solutions/beecrowd/2533/tags.txt diff --git a/solutions/beecrowd/2533/2533.py b/solutions/beecrowd/2533/2533.py new file mode 100644 index 00000000..6c4f4c79 --- /dev/null +++ b/solutions/beecrowd/2533/2533.py @@ -0,0 +1,13 @@ +import sys + +for n in sys.stdin: + n = int(n) + sum_n_c = 0 + sum_c = 0 + + for _ in range(n): + n, c = map(int, input().split()) + sum_n_c += n * c + sum_c += c + + print(f'{sum_n_c/(sum_c * 100):.4f}') diff --git a/solutions/beecrowd/2533/generate_in.sh b/solutions/beecrowd/2533/generate_in.sh new file mode 100755 index 00000000..1fdac370 --- /dev/null +++ b/solutions/beecrowd/2533/generate_in.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -euo pipefail + +TESTCASES=1000 +MAX_M=40 +MAX_N=100 +MAX_C=90 + +for _ in $(seq "${TESTCASES}"); do + m=$((RANDOM % MAX_M + 1)) + echo "${m}" + for _ in $(seq "${m}"); do + echo "$((RANDOM % (MAX_N + 1))) $((RANDOM % MAX_C + 30))" + done +done diff --git a/solutions/beecrowd/2533/imgs/estagio_fig.png b/solutions/beecrowd/2533/imgs/estagio_fig.png new file mode 100644 index 0000000000000000000000000000000000000000..d8cc34769f16d2a552210942ecf40d7a1ed885a9 GIT binary patch literal 888 zcmeAS@N?(olHy`uVBq!ia0vp^DL|aY!3-q1z8uK~QU(D&A+GKPK0qe%K-K4qB~Ueg zNswPKgMgBeOGsK-=gif+&)$9CXXV|>z`*pv)5S5Q;?~<6cUL{O;&FJWdVJd2KR^H8 z|K`AVOy$t-61AC)iuZf-r>x4|ReqXj*M>6;h2e5bv=wev1l?+g5aRFJ#Nl}DK(k1< zi`l#-E8LdNR9Af@b7JQ66E@1NTO`+CugzMUz4`6e1$T7f<%%zD&AXGk(zHP6`-wuf zx~WBKyQ`lWF|#}k|Cyb<_E;o~L7lVMIj^;x>S+vWtJzNMnf*a{>zvI;PAE!CI%3#@{`AMd{P5=H^Y>6IhNtl4F<=_8>u6eC4%A^Q3Y;Z!#R+Kh^S} zs%dgH#0~${I8V! z`bSVLBGC83aJJm2>t8w!N)^lIJ)qmaOdQNTkZ}09< z%hRSsn{Q^Qw5-^6eeUe3uSD~vU77rS`lI;tM!ht-<;Bk`XH_}`RM&Y&q6C1O0&|} zNA4@(`@J;nx|P58GOi8F%b2D(zLfcPI%QqyylF?cHe^~idd9xAS(zFl7W-O8-%xUz z-+g`EFRJ@W`|hu+46r)>*Jx_->o4YUeXnnE>NH<^`8##-&Fy~w1=sy;Ne!{8-OrO{ z8^7z?P2t627w-6PFwmI0E`FQGE`yA@!8ccFPB0aJp+0%nCCd;Yfu8qMfi}Bd68bUk z#fFl&nN9)wKJP54y8i~|+iB;vm+V{m+3i2$lE*4@Zp>T-%2y1Yu6{1-oD!M + +, where $N_1, N_2, ..., N_M$ are your grades in each subject, and $C_1, C_2, +..., C_M$ are the workload of the respective subjects. + +Given the grades you got and the workload of each subject, determine your API, +so you can send it to Googlbook as soon as possible! Input + +The input contains several test cases. The first line of each test case contains +integer $M (1 ≤ M ≤ 40)$, the number of subjects you coursed. Each of the next M +lines describe a subject. Each line contains two integers $N_i$ and $C_i (0 ≤ +N_i ≤ 100, 30 ≤ C_i ≤ 120)$, indicating the grade you got in that subject and +its workload, respectively. + +The input ends with end-of-file (EOF). Output + +For each test case, print a line containing your API. Round and print it with +exactly 4 decimal places. + + + diff --git a/solutions/beecrowd/2533/tags.txt b/solutions/beecrowd/2533/tags.txt new file mode 100644 index 00000000..ae224c24 --- /dev/null +++ b/solutions/beecrowd/2533/tags.txt @@ -0,0 +1 @@ +beginner