题解 | 异或
异或
https://www.nowcoder.com/practice/4c788d7749874d4387843fe2ff99a2f3
异或为0只有当两数相等的情况下才行,所以只需求(两数交集大小)//(a数组大小)*(b数组大小),用gcd求出最简表达式即可
from math import gcd
import sys
input = lambda : sys.stdin.read().strip()
op = list(map(int,input().split()))
for i in range(0,len(op),4):
a,b,c,d = op[i:i+4]
if c > b or d < a :
print("0/1")
else :
l = max(a,c);r=min(b,d)
n,m = (b-a+1)*(d-c+1),abs(r-l+1)
c = gcd(n,m)
print(f"{m//c}/{n//c}")
