Skip to content

Commit

Permalink
Improve input/output files
Browse files Browse the repository at this point in the history
  • Loading branch information
deniscostadsc committed Nov 20, 2024
1 parent 5d17038 commit 70a3b83
Show file tree
Hide file tree
Showing 4 changed files with 6,513 additions and 2 deletions.
5 changes: 3 additions & 2 deletions solutions/beecrowd/1542/1542.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#include <cmath>
#include <cstdint>
#include <iomanip>
#include <iostream>

int main() {
std::int16_t q, d, p, answer;
double q, d, p, answer;

while (std::cin >> q && q) {
std::cin >> d >> p;

answer = trunc(static_cast< double >((q * d) / -(q - p) * p));
answer = trunc(((d * p) / (p - q)) * q);

std::cout << answer << " pagina";
if (answer > 1) {
Expand Down
14 changes: 14 additions & 0 deletions solutions/beecrowd/1542/generate_in.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -euo pipefail

for q in $(seq 1 19); do
for d in $(seq 1 19); do
for p in $(seq 1 19); do
if [[ q -lt p ]]; then
echo "${q} ${d} ${p}"
fi
done
done
done
echo "0"
Loading

0 comments on commit 70a3b83

Please sign in to comment.