summaryrefslogtreecommitdiff
path: root/bio/3/3.c
diff options
context:
space:
mode:
authorthing1 <thing1@seacrossedlovers.xyz>2025-01-31 16:22:52 +0000
committerthing1 <thing1@seacrossedlovers.xyz>2025-01-31 16:22:52 +0000
commit45b06ac98819bfcad5f490c580d25fb0bf90c8ad (patch)
tree4f00b8a96847bccc605eea0e7154a3bd36a2fb5a /bio/3/3.c
parent00e419fa183247d6d94b7eaf274bd2ae6225c646 (diff)
parent02653ab40d93fb7e6d07edb747fe0e07c5d60c74 (diff)
performing merge
Merge branch 'master' of git://git.seacrossedlovers.xyz/school
Diffstat (limited to 'bio/3/3.c')
-rw-r--r--bio/3/3.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/bio/3/3.c b/bio/3/3.c
new file mode 100644
index 0000000..3ecb08d
--- /dev/null
+++ b/bio/3/3.c
@@ -0,0 +1,27 @@
+#include <stdio.h>
+
+int main() {
+ int fusecount;
+ scanf("%d", &fusecount);
+ int fuses[fusecount];
+
+ for (int i = 0; i < fusecount; i++)
+ scanf("%d", &fuses[i]);
+
+ float burntimes[fusecount * 3];
+ int counter = 0;
+ for (int i = 0; i < fusecount; i++) {
+ for (int j = 0; j < 3; j++) { // for each state, (dont light, light, light both ends)
+ if (j == 0) burntimes[counter] = 0;
+ else if (j == 1) burntimes[counter] = fuses[i];
+ else if (j == 2) burntimes[counter] = (float)fuses[i] / 2.0;
+ counter++;
+ }
+ }
+
+ for (int i = 0; i < counter/2; i++) {
+ for (int j = counter-1; j > counter/2; j--){
+ printf("%f %f\n", burntimes[i], burntimes[j]);
+ }
+ }
+}