Pathology

A 36-year-old woman has had increased malaise for 3 weeks and urine output <500 mL/day for the past 4 days. On examination, she has blood pressure 170/112 mm Hg and peripheral edema. Urinalysis shows protein 1+ and blood 3+, but no glucose or ketones. Urine microscopic analysis shows RBCs and RBC casts. Her serum urea nitrogen is 39 mg/dL, and creatinine is 4.3 mg/dL. Her serum complement C1q, C3, and C4 are decreased. A renal biopsy is performed, and immunofluorescence microscopy shows a granular pattern of staining with antibody to C3. Which of the following types of hypersensitivity reactions is most likely causing her renal disease?