---
# System prepended metadata

title: 2849. Determine if a Cell Is Reachable at a Given Time
tags: [Leetcode]

---

# 2849. Determine if a Cell Is Reachable at a Given Time

給定起點跟終點，是否能在時間內從起點到終點，移動方式是周圍8格，一秒一步


```python
class Solution:
    def isReachableAtTime(self, sx: int, sy: int, fx: int, fy: int, t: int) -> bool:
        width = abs(sx - fx)
        height = abs(sy - fy)
        if width == 0 and height == 0 and t == 1:
            return False
        return t >= max(width, height)
```