Skip to content

Instantly share code, notes, and snippets.

@modos
Created March 8, 2023 12:32
Show Gist options
  • Save modos/eade0243d5025b6310b45640a2067f62 to your computer and use it in GitHub Desktop.
Save modos/eade0243d5025b6310b45640a2067f62 to your computer and use it in GitHub Desktop.
Donuts and the Giant Pizza
#include <iostream>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int tc;
cin >> tc;
while (tc--)
{
int r, w, h;
cin >> r >> w >> h;
if (w * w + h * h <= 4 * r * r)
cout << "Pizza fits on the table.\n";
else
cout << "Pizza does not fit on the table.\n";
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment