Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Coding Quiz 5

COMP9021 PRINCIPLES OF PROGRAMMING

Term 3, 2022

$    python3 quiz_5.py

Enter  two  integers,  the  second  one  being  strictly  positive:    0 1

Here  is  the  grid  that  has  been  generated:

0  0  0  0  0  0  0  0  0  0

0  0  0  0  0  0  0  0  0  0

0  0  0  0  0  0  0  0  0  0

0  0  0  0  0  0  0  0  0  0

0  0  0  0  0  0  0  0  0  0

0  0  0  0  0  0  0  0  0  0

0  0  0  0  0  0  0  0  0  0

0  0  0  0  0  0  0  0  0  0

0  0  0  0  0  0  0  0  0  0

0  0  0  0  0  0  0  0  0  0

There  is  no  parallelogram  with  horizontal  sides.

$    python3 quiz_5.py

Enter  two  integers,  the  second  one  being  strictly  positive:    0 2

Here  is  the  grid  that  has  been  generated:

1  1  0  1  1  1  1  1  1  0

0  1  0  0  1  0  1  0  0  1

1  0  1  1  1  0  1  1  1  0

0  0  1  0  1  1  0  1  0  0

0  0  0  1  0  0  1  1  0  1

1  0  1  0  1  1  0  1  1  0

1  0  0  0  0  1  1  0  0  0

0  0  0  1  1  0  0  1  1  1

1  1  0  1  0  1  1  0  0  0

1  0  0  1  0  1  1  0  0  0

The largest parallelogram with horizontal  sides has  a size of 4.

$    python3 quiz_5.py

Enter  two  integers,  the  second  one  being  strictly  positive:    0 3

Here  is  the  grid  that  has  been  generated:

1  1  0  1  1  1  1  1  1  1 

1  0  1  0  1  0  0  1  1  1 

1  1  0  1  0  1  0  1  1  1 

1  0  1  1  1  1  1  0  1  1 

1  1  1  0  1  0  0  1  1  1 

1  1  0  1  1  1  0  1  1  1 

0  0  1  0  0  0  1  1  0  0

1  1  1  0  1  1  1  1  0  1

1  1  0  1  1  1  1  1  0  1

1  1  1  0  1  0  0  0  0  1

The largest  parallelogram  with  horizontal  sides  has  a  size  of  12.

$    python3 quiz_5.py

Enter  two  integers,  the  second Here  is  the  grid  that  has  been

1  1  0  1  1  1  1  1  1  1

1  1  1  0  1  1  1  0  0  1

1  0  1  1  1  1  1  1  1  0

0  0  1  0  1  1  1  1  0  1

1  1  1  1  0  0  1  1  0  1

1  0  1  1  1  1  0  1  1  1

1  1  1  1  0  1  1  0  0  1

1  0  0  1  1  1  1  1  1  1

1  1  0  1  0  1  1  1  1  0

1  0  1  1  1  1  1  0  0  1              The largest  parallelogram  with

$    python3 quiz_5.py

Enter  two  integers,  the  second Here  is  the  grid  that  has  been

1  0  1  0  1  1  1  1  1  0

1  0  1  1  0  1  1  1  0  1

0  0  0  0  1  1  1  0  1  1

1  1  1  1  1  1  1  0  1  0

1  1  0  1  1  1  1  1  1  1

0  1  1  1  1  1  1  1  0  1

0  1  1  1  1  0  1  0  1  1

1  1  1  0  1  1  1  1  1  1

1  0  1  1  1  1  0  1  1  1

1  1  1  1  1  0  1  1  0  1              The largest  parallelogram  with

$    python3 quiz_5.py

Enter  two  integers,  the  second Here  is  the  grid  that  has  been

1  1  0  1  1  1  1  1  1  1

1  1  1  1  1  1  0  1  1  1

1  1  1  0  0  1  1  1  0  1

1  1  1  1  1  1  1  1  1  0

1  0  0  1  0  1  1  1  1  1

0  1  1  1  1  1  1  1  0  0

1  1  1  0  1  1  1  0  1  1

1  1  1  1  1  1  1  0  1  1

1  1  1  1  1  1  1  0  1  1

1  0  0  1  1  0  0  1  1  1              The largest  parallelogram  with

one  being  strictly  positive:    0 4

generated:

horizontal  sides  has  a  size  of  12.

one  being  strictly  positive:    1 4

generated:

horizontal  sides  has  a  size  of  16.

one  being  strictly  positive:    0 5

generated:

horizontal  sides  has  a  size  of  15.