import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(0, 40, 100)
y1 = 40 - x
y2 = (100 - 2*x) / 4

fig, ax = plt.subplots(figsize=(8, 6))
ax.plot(x, y1, 'b-', linewidth=2, label='x + y = 40')
ax.plot(x, y2, 'r-', linewidth=2, label='2x + 4y = 100')

ax.plot(30, 10, 'go', markersize=12, label='Solution (30, 10)')
ax.annotate('Chicken=30, Rabbit=10', xy=(30, 10), xytext=(20, 20),
            arrowprops=dict(arrowstyle='->', color='green'),
            fontsize=12, color='green')

ax.set_xlabel('Chicken (x)', fontsize=12)
ax.set_ylabel('Rabbit (y)', fontsize=12)
ax.set_title('Problem 1: Graphical Solution', fontsize=14)
ax.legend(loc='upper right')
ax.grid(True, alpha=0.3)
ax.set_xlim(0, 40)
ax.set_ylim(0, 40)

plt.tight_layout()
plt.show()