Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <algorithm>
- #include <cstdio>
- #include <vector>
- #include <cmath>
- using namespace std;
- pair< int, int > red[ 100001 ];
- pair< int, int > blue[ 100001 ];
- int N, M;
- double sol = 0.0000;
- template< class Tip >
- Tip sqr ( Tip A ) {
- return A * A;
- }
- double pitagora ( pair< int, int > A, pair< int, int > B ) {
- return sqrt ( sqr ( abs ( A.first - B.first ) ) + sqr ( abs ( A.second - B.second ) ) );
- }
- int main() {
- scanf ( "%d", &N );
- for ( int i = 0 ; i < N ; ++i ) {
- scanf ( "%d %d", &red[ i ].first, &red[ i ].second );
- }
- scanf ( "%d", &M );
- for ( int i = 0 ; i < M ; ++i ) {
- scanf ( "%d %d", &blue[ i ].first, &blue[ i ].second );
- }
- for ( int i = 0 ; i < N ; ++i ) {
- for ( int j = 0 ; j < M ; ++j ) {
- sol = max ( pitagora ( red[ i ], blue[ j ] ), sol );
- }
- }
- printf ( "%.3lf\n", sol );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement