According to the Rome IV criteria, which symptom pattern is required for the diagnosis of irritable bowel syndrome (IBS)?